From: Richard Trieu Date: Thu, 28 Jul 2011 20:30:10 +0000 (+0000) Subject: Fix a test case that was intermittently failing. The issue was that instantiations... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7efa0e03828dd13e53f5310fc80471604f298d48;p=clang 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136385 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/Misc/ast-dump-templates.cpp b/test/Misc/ast-dump-templates.cpp index ea3455679d..7d56e7b04e 100644 --- a/test/Misc/ast-dump-templates.cpp +++ b/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 struct foo { @@ -20,14 +21,19 @@ void baz() { } // Template instantiation - foo -// CHECK: template struct foo { -// CHECK: template 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 struct foo { +// CHECK2: template struct foo { // Template definition - foo -// CHECK: template int bar() +// CHECK1: template int bar() +// CHECK2: template int bar() // Template definition - bar -// CHECK: template B bar() +// CHECK1: template B bar() +// CHECK2: template B bar()