diff options
| author | Richard Trieu <rtrieu@google.com> | 2011-07-28 20:30:10 +0000 |
|---|---|---|
| committer | Richard Trieu <rtrieu@google.com> | 2011-07-28 20:30:10 +0000 |
| commit | ff5dc53c7a2d787ed4b557ec2395e35f3cf8feba (patch) | |
| tree | b5ae17543f040abbaf8bda1fe6b08724a62e0bee | |
| parent | 14852b182e84f260a6eb80d7a17a1c71bac77802 (diff) | |
| download | bcm5719-llvm-ff5dc53c7a2d787ed4b557ec2395e35f3cf8feba.tar.gz bcm5719-llvm-ff5dc53c7a2d787ed4b557ec2395e35f3cf8feba.zip | |
Fix a test case that was intermittently failing. The issue was that instantiations are not stored in an order preserving structure, so the print order may be impacted. Modified test case to do two FileCheck passes to ensure that both instantiations are in the same place.
Test originially commited at r136306 and temporarily silenced at r136348.
llvm-svn: 136385
| -rw-r--r-- | clang/test/Misc/ast-dump-templates.cpp | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/clang/test/Misc/ast-dump-templates.cpp b/clang/test/Misc/ast-dump-templates.cpp index ea3455679d5..7d56e7b04eb 100644 --- a/clang/test/Misc/ast-dump-templates.cpp +++ b/clang/test/Misc/ast-dump-templates.cpp @@ -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() |

