[PATCH] D30430: Make Lit tests C++11 compatible - IR ordering

Phabricator via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 28 16:21:52 PST 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL296549: [Test] Make Lit tests C++11 compatible - IR ordering (authored by lcharles).

Changed prior to commit:
  https://reviews.llvm.org/D30430?vs=90078&id=90101#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D30430

Files:
  cfe/trunk/test/CodeGenCXX/template-instantiation.cpp


Index: cfe/trunk/test/CodeGenCXX/template-instantiation.cpp
===================================================================
--- cfe/trunk/test/CodeGenCXX/template-instantiation.cpp
+++ cfe/trunk/test/CodeGenCXX/template-instantiation.cpp
@@ -1,21 +1,22 @@
-// RUN: %clang_cc1 %s -O1 -disable-llvm-passes -triple=x86_64-apple-darwin10 -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 %s -O1 -disable-llvm-passes -triple=x86_64-apple-darwin10 -std=c++11 -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 %s -O1 -disable-llvm-passes -triple=x86_64-apple-darwin10 -std=c++11 -emit-llvm -o - | FileCheck %s --check-prefix=CHECK2
 
-// CHECK: @_ZN7PR100011xE = global
-// CHECK-NOT: @_ZN7PR100014kBarE = external global i32
-//
-// CHECK-NOT: @_ZTVN5test118stdio_sync_filebufIwEE = constant
-// CHECK-NOT: _ZTVN5test315basic_fstreamXXIcEE
-// CHECK-NOT: @_ZTVN5test018stdio_sync_filebufIA1_iEE
-// CHECK-NOT: @_ZTVN5test018stdio_sync_filebufIA2_iEE
-// CHECK:     @_ZTVN5test018stdio_sync_filebufIA3_iEE = weak_odr unnamed_addr constant
+// Instantiation order varies on different C++ dialects (IE, between C++98 and C++11).
+// CHECK-DAG: @_ZN7PR100011xE = global
+// CHECK-DAG: @_ZTVN5test018stdio_sync_filebufIA3_iEE = weak_odr unnamed_addr constant
+// CHECK-DAG: @_ZN7PR100011SIiE3arrE = linkonce_odr global [3 x i32]
+// CHECK-DAG: @_ZTVN5test018stdio_sync_filebufIA4_iEE = linkonce_odr unnamed_addr constant
+
+// Negative checks go under prefix "CHECK2" to avoid interference with CHECK and CHECK-DAG.
+// CHECK2-NOT: @_ZN7PR100014kBarE = external global i32
+// CHECK2-NOT: @_ZTVN5test118stdio_sync_filebufIwEE = constant
+// CHECK2-NOT: _ZTVN5test315basic_fstreamXXIcEE
+// CHECK2-NOT: @_ZTVN5test018stdio_sync_filebufIA1_iEE
+// CHECK2-NOT: @_ZTVN5test018stdio_sync_filebufIA2_iEE
+// CHECK2-NOT: @_ZN7PR100011SIiE3arr2E = linkonce_odr global [3 x i32]A
 
-// CHECK: @_ZN7PR100011SIiE3arrE = linkonce_odr global [3 x i32]
-// CHECK-NOT: @_ZN7PR100011SIiE3arr2E = linkonce_odr global [3 x i32]A
-
-// CHECK:     @_ZTVN5test018stdio_sync_filebufIA4_iEE = linkonce_odr unnamed_addr constant
-
-// CHECK-NOT: _ZTVN5test31SIiEE
-// CHECK-NOT: _ZTSN5test31SIiEE
+// CHECK2-NOT: _ZTVN5test31SIiEE
+// CHECK2-NOT: _ZTSN5test31SIiEE
 
 // CHECK-LABEL: define linkonce_odr void @_ZN5test21CIiEC1Ev(%"class.test2::C"* %this) unnamed_addr
 // CHECK-LABEL: define linkonce_odr void @_ZN5test21CIiE6foobarIdEEvT_(
@@ -152,7 +153,7 @@
   void f () {}
 };
 // Should not instantiate class B since it is introduced in namespace scope.
-// CHECK-NOT: _ZN6PR85051AILi0EE1B1fEv
+// CHECK2-NOT: _ZN6PR85051AILi0EE1B1fEv
 template class A<0>;
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D30430.90101.patch
Type: text/x-patch
Size: 2638 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170301/25aa9025/attachment.bin>


More information about the cfe-commits mailing list