r189280 - Use CHECK-DAG in this test.

Rafael Espindola rafael.espindola at gmail.com
Mon Aug 26 15:10:32 PDT 2013


Author: rafael
Date: Mon Aug 26 17:10:31 2013
New Revision: 189280

URL: http://llvm.org/viewvc/llvm-project?rev=189280&view=rev
Log:
Use CHECK-DAG in this test.

Modified:
    cfe/trunk/test/CodeGenCXX/vtable-linkage.cpp

Modified: cfe/trunk/test/CodeGenCXX/vtable-linkage.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/vtable-linkage.cpp?rev=189280&r1=189279&r2=189280&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/vtable-linkage.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/vtable-linkage.cpp Mon Aug 26 17:10:31 2013
@@ -1,24 +1,9 @@
 // RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -emit-llvm -o %t
 // RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -fhidden-weak-vtables -emit-llvm -o %t.hidden
 // RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -disable-llvm-optzns -O3 -emit-llvm -o %t.opt
-// RUN: FileCheck --check-prefix=CHECK-1 %s < %t
-// RUN: FileCheck --check-prefix=CHECK-2 %s < %t
-// RUN: FileCheck --check-prefix=CHECK-2-HIDDEN %s < %t.hidden
-// RUN: FileCheck --check-prefix=CHECK-3 %s < %t
-// RUN: FileCheck --check-prefix=CHECK-4 %s < %t
-// RUN: FileCheck --check-prefix=CHECK-5 %s < %t
-// RUN: FileCheck --check-prefix=CHECK-5-HIDDEN %s < %t.hidden
-// RUN: FileCheck --check-prefix=CHECK-6 %s < %t
-// RUN: FileCheck --check-prefix=CHECK-6-HIDDEN %s < %t.hidden
-// RUN: FileCheck --check-prefix=CHECK-7 %s < %t
-// RUN: FileCheck --check-prefix=CHECK-8 %s < %t
-// RUN: FileCheck --check-prefix=CHECK-9 %s < %t
-// RUN: FileCheck --check-prefix=CHECK-9-OPT %s < %t.opt
-// RUN: FileCheck --check-prefix=CHECK-10 %s < %t
-// RUN: FileCheck --check-prefix=CHECK-10-OPT %s < %t.opt
-// RUN: FileCheck --check-prefix=CHECK-11 %s < %t
-// RUN: FileCheck --check-prefix=CHECK-12 %s < %t
-// RUN: FileCheck --check-prefix=CHECK-13 %s < %t
+// RUN: FileCheck --check-prefix=CHECK %s < %t
+// RUN: FileCheck --check-prefix=CHECK-HIDDEN %s < %t.hidden
+// RUN: FileCheck --check-prefix=CHECK-OPT %s < %t.opt
 
 namespace {
   struct A {
@@ -102,96 +87,94 @@ void use_F() {
 
 // B has a key function that is not defined in this translation unit so its vtable
 // has external linkage.
-// CHECK-1: @_ZTV1B = external unnamed_addr constant
+// CHECK-DAG: @_ZTV1B = external unnamed_addr constant
 
 // C has no key function, so its vtable should have weak_odr linkage
 // and hidden visibility (rdar://problem/7523229).
-// CHECK-2: @_ZTV1C = linkonce_odr unnamed_addr constant
-// CHECK-2: @_ZTS1C = linkonce_odr constant
-// CHECK-2: @_ZTI1C = linkonce_odr unnamed_addr constant
-// CHECK-2: @_ZTT1C = linkonce_odr unnamed_addr constant
-// CHECK-2-HIDDEN: @_ZTV1C = linkonce_odr hidden unnamed_addr constant
-// CHECK-2-HIDDEN: @_ZTS1C = linkonce_odr constant
-// CHECK-2-HIDDEN: @_ZTI1C = linkonce_odr hidden unnamed_addr constant
-// CHECK-2-HIDDEN: @_ZTT1C = linkonce_odr hidden unnamed_addr constant
+// CHECK-DAG: @_ZTV1C = linkonce_odr unnamed_addr constant
+// CHECK-DAG: @_ZTS1C = linkonce_odr constant
+// CHECK-DAG: @_ZTI1C = linkonce_odr unnamed_addr constant
+// CHECK-DAG: @_ZTT1C = linkonce_odr unnamed_addr constant
+// CHECK-HIDDEN-DAG: @_ZTV1C = linkonce_odr hidden unnamed_addr constant
+// CHECK-HIDDEN-DAG: @_ZTS1C = linkonce_odr constant
+// CHECK-HIDDEN-DAG: @_ZTI1C = linkonce_odr hidden unnamed_addr constant
+// CHECK-HIDDEN-DAG: @_ZTT1C = linkonce_odr hidden unnamed_addr constant
 
 // D has a key function that is defined in this translation unit so its vtable is
 // defined in the translation unit.
-// CHECK-3: @_ZTV1D = unnamed_addr constant
-// CHECK-3: @_ZTS1D = constant
-// CHECK-3: @_ZTI1D = unnamed_addr constant
+// CHECK-DAG: @_ZTV1D = unnamed_addr constant
+// CHECK-DAG: @_ZTS1D = constant
+// CHECK-DAG: @_ZTI1D = unnamed_addr constant
 
 // E<char> is an explicit specialization with a key function defined
 // in this translation unit, so its vtable should have external
 // linkage.
-// CHECK-4: @_ZTV1EIcE = unnamed_addr constant
-// CHECK-4: @_ZTS1EIcE = constant
-// CHECK-4: @_ZTI1EIcE = unnamed_addr constant
+// CHECK-DAG: @_ZTV1EIcE = unnamed_addr constant
+// CHECK-DAG: @_ZTS1EIcE = constant
+// CHECK-DAG: @_ZTI1EIcE = unnamed_addr constant
 
 // E<short> is an explicit template instantiation with a key function
 // defined in this translation unit, so its vtable should have
 // weak_odr linkage.
-// CHECK-5: @_ZTV1EIsE = weak_odr unnamed_addr constant
-// CHECK-5: @_ZTS1EIsE = weak_odr constant
-// CHECK-5: @_ZTI1EIsE = weak_odr unnamed_addr constant
-// CHECK-5-HIDDEN: @_ZTV1EIsE = weak_odr unnamed_addr constant
-// CHECK-5-HIDDEN: @_ZTS1EIsE = weak_odr constant
-// CHECK-5-HIDDEN: @_ZTI1EIsE = weak_odr unnamed_addr constant
+// CHECK-DAG: @_ZTV1EIsE = weak_odr unnamed_addr constant
+// CHECK-DAG: @_ZTS1EIsE = weak_odr constant
+// CHECK-DAG: @_ZTI1EIsE = weak_odr unnamed_addr constant
+// CHECK-HIDDEN-DAG: @_ZTV1EIsE = weak_odr unnamed_addr constant
+// CHECK-HIDDEN-DAG: @_ZTS1EIsE = weak_odr constant
+// CHECK-HIDDEN-DAG: @_ZTI1EIsE = weak_odr unnamed_addr constant
 
 // F<short> is an explicit template instantiation without a key
 // function, so its vtable should have weak_odr linkage
-// CHECK-6: @_ZTV1FIsE = weak_odr unnamed_addr constant
-// CHECK-6: @_ZTS1FIsE = weak_odr constant
-// CHECK-6: @_ZTI1FIsE = weak_odr unnamed_addr constant
-// CHECK-6-HIDDEN: @_ZTV1FIsE = weak_odr unnamed_addr constant
-// CHECK-6-HIDDEN: @_ZTS1FIsE = weak_odr constant
-// CHECK-6-HIDDEN: @_ZTI1FIsE = weak_odr unnamed_addr constant
+// CHECK-DAG: @_ZTV1FIsE = weak_odr unnamed_addr constant
+// CHECK-DAG: @_ZTS1FIsE = weak_odr constant
+// CHECK-DAG: @_ZTI1FIsE = weak_odr unnamed_addr constant
+// CHECK-HIDDEN-DAG: @_ZTV1FIsE = weak_odr unnamed_addr constant
+// CHECK-HIDDEN-DAG: @_ZTS1FIsE = weak_odr constant
+// CHECK-HIDDEN-DAG: @_ZTI1FIsE = weak_odr unnamed_addr constant
 
 // E<long> is an implicit template instantiation with a key function
 // defined in this translation unit, so its vtable should have
 // linkonce_odr linkage.
-// CHECK-7: @_ZTV1EIlE = linkonce_odr unnamed_addr constant
-// CHECK-7: @_ZTS1EIlE = linkonce_odr constant
-// CHECK-7: @_ZTI1EIlE = linkonce_odr unnamed_addr constant
+// CHECK-DAG: @_ZTV1EIlE = linkonce_odr unnamed_addr constant
+// CHECK-DAG: @_ZTS1EIlE = linkonce_odr constant
+// CHECK-DAG: @_ZTI1EIlE = linkonce_odr unnamed_addr constant
 
 // F<long> is an implicit template instantiation with no key function,
 // so its vtable should have linkonce_odr linkage.
-// CHECK-8: @_ZTV1FIlE = linkonce_odr unnamed_addr constant
-// CHECK-8: @_ZTS1FIlE = linkonce_odr constant
-// CHECK-8: @_ZTI1FIlE = linkonce_odr unnamed_addr constant
+// CHECK-DAG: @_ZTV1FIlE = linkonce_odr unnamed_addr constant
+// CHECK-DAG: @_ZTS1FIlE = linkonce_odr constant
+// CHECK-DAG: @_ZTI1FIlE = linkonce_odr unnamed_addr constant
 
 // F<int> is an explicit template instantiation declaration without a
 // key function, so its vtable should have external linkage.
-// CHECK-9: @_ZTV1FIiE = external unnamed_addr constant
-// CHECK-9-OPT: @_ZTV1FIiE = available_externally unnamed_addr constant
+// CHECK-DAG: @_ZTV1FIiE = external unnamed_addr constant
+// CHECK-OPT-DAG: @_ZTV1FIiE = available_externally unnamed_addr constant
 
 // E<int> is an explicit template instantiation declaration. It has a
 // key function that is not instantiated, so we should only reference
 // its vtable, not define it.
-// CHECK-10: @_ZTV1EIiE = external unnamed_addr constant
-// CHECK-10-OPT: @_ZTV1EIiE = available_externally unnamed_addr constant
+// CHECK-DAG: @_ZTV1EIiE = external unnamed_addr constant
+// CHECK-OPT-DAG: @_ZTV1EIiE = available_externally unnamed_addr constant
 
 // The anonymous struct for e has no linkage, so the vtable should have
 // internal linkage.
-// CHECK-11: @"_ZTV3$_0" = internal unnamed_addr constant
-// CHECK-11: @"_ZTS3$_0" = internal constant
-// CHECK-11: @"_ZTI3$_0" = internal unnamed_addr constant
+// CHECK-DAG: @"_ZTV3$_0" = internal unnamed_addr constant
+// CHECK-DAG: @"_ZTS3$_0" = internal constant
+// CHECK-DAG: @"_ZTI3$_0" = internal unnamed_addr constant
 
 // The A vtable should have internal linkage since it is inside an anonymous 
 // namespace.
-// CHECK-12: @_ZTVN12_GLOBAL__N_11AE = internal unnamed_addr constant
-// CHECK-12: @_ZTSN12_GLOBAL__N_11AE = internal constant
-// CHECK-12: @_ZTIN12_GLOBAL__N_11AE = internal unnamed_addr constant
+// CHECK-DAG: @_ZTVN12_GLOBAL__N_11AE = internal unnamed_addr constant
+// CHECK-DAG: @_ZTSN12_GLOBAL__N_11AE = internal constant
+// CHECK-DAG: @_ZTIN12_GLOBAL__N_11AE = internal unnamed_addr constant
 
 // F<char> is an explicit specialization without a key function, so
 // its vtable should have linkonce_odr linkage.
-// CHECK-13: @_ZTV1FIcE = linkonce_odr unnamed_addr constant
-// CHECK-13: @_ZTS1FIcE = linkonce_odr constant
-// CHECK-13: @_ZTI1FIcE = linkonce_odr unnamed_addr constant
+// CHECK-DAG: @_ZTV1FIcE = linkonce_odr unnamed_addr constant
+// CHECK-DAG: @_ZTS1FIcE = linkonce_odr constant
+// CHECK-DAG: @_ZTI1FIcE = linkonce_odr unnamed_addr constant
 
-// RUN: FileCheck --check-prefix=CHECK-G %s < %t
-//
-// CHECK-G: @_ZTV1GIiE = linkonce_odr unnamed_addr constant
+// CHECK-DAG: @_ZTV1GIiE = linkonce_odr unnamed_addr constant
 template <typename T>
 class G {
 public:
@@ -205,11 +188,9 @@ template <typename T>
 void G<T>::f0() {}
 void G_f0()  { new G<int>(); }
 
-// RUN: FileCheck --check-prefix=CHECK-H %s < %t
-
 // H<int> has a key function without a body but it's a template instantiation
 // so its VTable must be emitted.
-// CHECK-H: @_ZTV1HIiE = linkonce_odr unnamed_addr constant
+// CHECK-DAG: @_ZTV1HIiE = linkonce_odr unnamed_addr constant
 template <typename T>
 class H {
 public:
@@ -220,21 +201,18 @@ void use_H() {
   H<int> h;
 }
 
-// RUN: FileCheck --check-prefix=CHECK-I %s < %t
-// RUN: FileCheck --check-prefix=CHECK-I-OPT %s < %t.opt
-
 // I<int> has an explicit instantiation declaration and needs a VTT and
 // construction vtables. We emit the VTT available_externally, but point it at
 // internal construction vtables because there is no way to form a reference to
 // the real construction vtables.
 
-// CHECK-I: @_ZTV1IIiE = external unnamed_addr constant
-// CHECK-I: @_ZTT1IIiE = external unnamed_addr constant
-// CHECK-I-NOT: @_ZTC1IIiE
+// CHECK-DAG: @_ZTV1IIiE = external unnamed_addr constant
+// CHECK-DAG: @_ZTT1IIiE = external unnamed_addr constant
+// CHECK-NOT: @_ZTC1IIiE
 //
-// CHECK-I-OPT: @_ZTV1IIiE = available_externally unnamed_addr constant
-// CHECK-I-OPT: @_ZTT1IIiE = available_externally unnamed_addr constant {{.*}} @_ZTC1IIiE0_6VBase2
-// CHECK-I-OPT: @_ZTC1IIiE0_6VBase2 = internal unnamed_addr constant
+// CHECK-OPT-DAG: @_ZTV1IIiE = available_externally unnamed_addr constant
+// CHECK-OPT-DAG: @_ZTT1IIiE = available_externally unnamed_addr constant {{.*}} @_ZTC1IIiE0_6VBase2
+// CHECK-OPT-DAG: @_ZTC1IIiE0_6VBase2 = internal unnamed_addr constant
 struct VBase1 { virtual void f(); }; struct VBase2 : virtual VBase1 {};
 template<typename T>
 struct I : VBase2 {};





More information about the cfe-commits mailing list