r216807 - Cleanup test.

Rafael Espindola rafael.espindola at gmail.com
Fri Aug 29 17:15:37 PDT 2014


Author: rafael
Date: Fri Aug 29 19:15:37 2014
New Revision: 216807

URL: http://llvm.org/viewvc/llvm-project?rev=216807&view=rev
Log:
Cleanup test.

This should make it easier to add more tests to this file.

Modified:
    cfe/trunk/test/CodeGenCXX/ctor-dtor-alias.cpp

Modified: cfe/trunk/test/CodeGenCXX/ctor-dtor-alias.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/ctor-dtor-alias.cpp?rev=216807&r1=216806&r2=216807&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/ctor-dtor-alias.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/ctor-dtor-alias.cpp Fri Aug 29 19:15:37 2014
@@ -1,8 +1,11 @@
-// RUN: %clang_cc1 %s -triple i686-linux -emit-llvm -o - -mconstructor-aliases -O1 -disable-llvm-optzns | FileCheck %s
 // RUN: %clang_cc1 %s -triple i686-linux -emit-llvm -o - -mconstructor-aliases | FileCheck --check-prefix=NOOPT %s
 
-// RUN: %clang_cc1 -triple x86_64--netbsd -emit-llvm \
-// RUN: -mconstructor-aliases -O2 %s -o - | FileCheck --check-prefix=CHECK-RAUW %s
+// RUN: %clang_cc1 %s -triple i686-linux -emit-llvm -o - -mconstructor-aliases -O1 -disable-llvm-optzns > %t
+// RUN: FileCheck --check-prefix=CHECK1 --input-file=%t %s
+// RUN: FileCheck --check-prefix=CHECK2 --input-file=%t %s
+// RUN: FileCheck --check-prefix=CHECK3 --input-file=%t %s
+// RUN: FileCheck --check-prefix=CHECK4 --input-file=%t %s
+// RUN: FileCheck --check-prefix=CHECK5 --input-file=%t %s
 
 namespace test1 {
 // test that we don't produce an alias when the destructor is weak_odr. The
@@ -10,8 +13,8 @@ namespace test1 {
 // instantiation definition or declaration, causing it to to output only
 // one of the destructors as linkonce_odr, producing a different comdat.
 
-// CHECK-DAG: define weak_odr void @_ZN5test16foobarIvEC2Ev
-// CHECK-DAG: define weak_odr void @_ZN5test16foobarIvEC1Ev
+// CHECK1: define weak_odr void @_ZN5test16foobarIvEC2Ev
+// CHECK1: define weak_odr void @_ZN5test16foobarIvEC1Ev
 
 template <typename T> struct foobar {
   foobar() {}
@@ -24,8 +27,9 @@ namespace test2 {
 // test that when the destrucor is linkonce_odr we just replace every use of
 // C1 with C2.
 
-// CHECK-DAG: define linkonce_odr void @_ZN5test26foobarIvEC2Ev(
-// CHECK-DAG: call void @_ZN5test26foobarIvEC2Ev
+// CHECK1: define internal void @__cxx_global_var_init()
+// CHECK1: call void @_ZN5test26foobarIvEC2Ev
+// CHECK1: define linkonce_odr void @_ZN5test26foobarIvEC2Ev(
 void g();
 template <typename T> struct foobar {
   foobar() { g(); }
@@ -37,8 +41,9 @@ namespace test3 {
 // test that instead of an internal alias we just use the other destructor
 // directly.
 
-// CHECK-DAG: define internal void @_ZN5test312_GLOBAL__N_11AD2Ev(
-// CHECK-DAG: call i32 @__cxa_atexit{{.*}}_ZN5test312_GLOBAL__N_11AD2Ev
+// CHECK1: define internal void @__cxx_global_var_init1()
+// CHECK1: call i32 @__cxa_atexit{{.*}}_ZN5test312_GLOBAL__N_11AD2Ev
+// CHECK1: define internal void @_ZN5test312_GLOBAL__N_11AD2Ev(
 namespace {
 struct A {
   ~A() {}
@@ -55,13 +60,15 @@ namespace test4 {
   // guarantee that they will be present in every TU. Instead, we just call
   // A's destructor directly.
 
-  // CHECK-DAG: define linkonce_odr void @_ZN5test41AD2Ev(
-  // CHECK-DAG: call i32 @__cxa_atexit{{.*}}_ZN5test41AD2Ev
+  // CHECK1: define internal void @__cxx_global_var_init2()
+  // CHECK1: call i32 @__cxa_atexit{{.*}}_ZN5test41AD2Ev
+  // CHECK1: define linkonce_odr void @_ZN5test41AD2Ev(
 
   // test that we don't do this optimization at -O0 so that the debugger can
   // see both destructors.
-  // NOOPT-DAG: call i32 @__cxa_atexit{{.*}}@_ZN5test41BD2Ev
-  // NOOPT-DAG: define linkonce_odr void @_ZN5test41BD2Ev
+  // NOOPT: define internal void @__cxx_global_var_init2()
+  // NOOPT: call i32 @__cxa_atexit{{.*}}@_ZN5test41BD2Ev
+  // NOOPT: define linkonce_odr void @_ZN5test41BD2Ev
   struct A {
     virtual ~A() {}
   };
@@ -74,8 +81,9 @@ namespace test4 {
 namespace test5 {
   // similar to test4, but with an internal B.
 
-  // CHECK-DAG: define linkonce_odr void @_ZN5test51AD2Ev(
-  // CHECK-DAG: call i32 @__cxa_atexit{{.*}}_ZN5test51AD2Ev
+  // CHECK2: define internal void @__cxx_global_var_init3()
+  // CHECK2: call i32 @__cxa_atexit{{.*}}_ZN5test51AD2Ev
+  // CHECK2: define linkonce_odr void @_ZN5test51AD2Ev(
   struct A {
     virtual ~A() {}
   };
@@ -99,14 +107,15 @@ namespace test6 {
   };
   }
   B X;
-  // CHECK-DAG: call i32 @__cxa_atexit({{.*}}@_ZN5test61AD2Ev
+  // CHECK3: define internal void @__cxx_global_var_init4()
+  // CHECK3: call i32 @__cxa_atexit({{.*}}@_ZN5test61AD2Ev
 }
 
 namespace test7 {
   // Test that we don't produce an alias from ~B to ~A<int> (or crash figuring
   // out if we should).
   // pr17875.
-  // CHECK-DAG: define void @_ZN5test71BD2Ev
+  // CHECK3: define void @_ZN5test71BD2Ev
   template <typename> struct A {
     ~A() {}
   };
@@ -119,8 +128,9 @@ namespace test7 {
 
 namespace test8 {
   // Test that we replace ~zed with ~bar which is an alias to ~foo.
-  // CHECK-DAG: call i32 @__cxa_atexit({{.*}}@_ZN5test83barD2Ev
-  // CHECK-DAG: @_ZN5test83barD2Ev = alias {{.*}} @_ZN5test83fooD2Ev
+  // CHECK4: @_ZN5test83barD2Ev = alias {{.*}} @_ZN5test83fooD2Ev
+  // CHECK4: define internal void @__cxx_global_var_init5()
+  // CHECK4: call i32 @__cxa_atexit({{.*}}@_ZN5test83barD2Ev
   struct foo {
     ~foo();
   };
@@ -144,12 +154,12 @@ struct bar : public foo {};
 void zed() {
   // Test that we produce a call to bar's destructor. We used to call foo's, but
   // it has a different calling conversion.
-  // CHECK-DAG: call void @_ZN5test93barD2Ev
+  // CHECK4: call void @_ZN5test93barD2Ev
   bar ptr;
 }
 }
 
-// CHECK-RAUW: @_ZTV1C = linkonce_odr unnamed_addr constant [4 x i8*] [{{[^@]*}}@_ZTI1C {{[^@]*}}@_ZN1CD2Ev {{[^@]*}}@_ZN1CD0Ev {{[^@]*}}]
+// CHECK5: @_ZTV1C = linkonce_odr unnamed_addr constant [4 x i8*] [{{[^@]*}}@_ZTI1C {{[^@]*}}@_ZN1CD2Ev {{[^@]*}}@_ZN1CD0Ev {{[^@]*}}]
 // r194296 replaced C::~C with B::~B without emitting the later.
 
 class A {





More information about the cfe-commits mailing list