]> granicus.if.org Git - clang/commitdiff
Fix a test case that was intermittently failing. The issue was that instantiations...
authorRichard Trieu <rtrieu@google.com>
Thu, 28 Jul 2011 20:30:10 +0000 (20:30 +0000)
committerRichard Trieu <rtrieu@google.com>
Thu, 28 Jul 2011 20:30:10 +0000 (20:30 +0000)
Test originially commited at r136306 and temporarily silenced at r136348.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136385 91177308-0d34-0410-b5e6-96231b3b80d8

test/Misc/ast-dump-templates.cpp

index ea3455679d564cd9df8ce17db1c5f10f9002deb5..7d56e7b04eb2d195825590ad36f5fda996e9fc39 100644 (file)
@@ -1,5 +1,6 @@
-// RxUN: %clang_cc1 -ast-dump %s | FileCheck %s
-// RUN: %clang_cc1 -ast-dump %s > /dev/null
+// RUN: %clang_cc1 -ast-dump %s > %t
+// RUN: FileCheck < %t %s -check-prefix=CHECK1
+// RUN: FileCheck < %t %s -check-prefix=CHECK2
 
 template <int X, typename Y, int Z = 5>
 struct foo {
@@ -20,14 +21,19 @@ void baz() {
 }
 
 // Template instantiation - foo
-// CHECK: template <int X = 5, typename Y = int, int Z = 5> struct foo {
-// CHECK: template <int X = 2, typename Y = double, int Z = 3> struct foo {
+// Since the order of instantiation may vary during runs, run FileCheck twice
+// to make sure each instantiation is in the correct spot.
+// CHECK1: template <int X = 5, typename Y = int, int Z = 5> struct foo {
+// CHECK2: template <int X = 2, typename Y = double, int Z = 3> struct foo {
 
 // Template definition - foo
-// CHECK: template <int X, typename Y, int Z = (IntegerLiteral {{.*}} 'int' 5)
+// CHECK1: template <int X, typename Y, int Z = (IntegerLiteral {{.*}} 'int' 5)
+// CHECK2: template <int X, typename Y, int Z = (IntegerLiteral {{.*}} 'int' 5)
 
 // Template instantiation - bar
-// CHECK: template <int A = 5, typename B = int> int bar()
+// CHECK1: template <int A = 5, typename B = int> int bar()
+// CHECK2: template <int A = 5, typename B = int> int bar()
 
 // Template definition - bar
-// CHECK: template <int A, typename B> B bar()
+// CHECK1: template <int A, typename B> B bar()
+// CHECK2: template <int A, typename B> B bar()