r216892 - Test cleanup: move CHECK close to code.

Rafael Espindola rafael.espindola at gmail.com
Mon Sep 1 15:29:32 PDT 2014


Author: rafael
Date: Mon Sep  1 17:29:32 2014
New Revision: 216892

URL: http://llvm.org/viewvc/llvm-project?rev=216892&view=rev
Log:
Test cleanup: move CHECK close to code.

Modified:
    cfe/trunk/test/CodeGenCXX/destructors.cpp

Modified: cfe/trunk/test/CodeGenCXX/destructors.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/destructors.cpp?rev=216892&r1=216891&r2=216892&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/destructors.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/destructors.cpp Mon Sep  1 17:29:32 2014
@@ -3,6 +3,7 @@
 // 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
 
 struct A {
   int a;
@@ -183,14 +184,62 @@ namespace test3 {
   void test() {
     new D; // Force emission of D's vtable
   }
+
+  // CHECK4-LABEL: define internal void @_ZN5test312_GLOBAL__N_11DD0Ev(%"struct.test3::(anonymous namespace)::D"* %this) unnamed_addr
+  // CHECK4: invoke void {{.*}} @_ZN5test312_GLOBAL__N_11CD2Ev
+  // CHECK4: call void @_ZdlPv({{.*}}) [[NUW:#[0-9]+]]
+  // CHECK4: ret void
+  // CHECK4: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+  // CHECK4-NEXT: cleanup
+  // CHECK4: call void @_ZdlPv({{.*}}) [[NUW]]
+  // CHECK4: resume { i8*, i32 }
+
+  // CHECK4-LABEL: define internal void @_ZThn8_N5test312_GLOBAL__N_11DD1Ev(
+  // CHECK4: getelementptr inbounds i8* {{.*}}, i64 -8
+  // CHECK4: call void {{.*}} @_ZN5test312_GLOBAL__N_11CD2Ev
+  // CHECK4: ret void
+
+  // CHECK4-LABEL: define internal void @_ZThn8_N5test312_GLOBAL__N_11DD0Ev(
+  // CHECK4: getelementptr inbounds i8* {{.*}}, i64 -8
+  // CHECK4: call void @_ZN5test312_GLOBAL__N_11DD0Ev(
+  // CHECK4: ret void
+
+  // CHECK4-LABEL: define internal void @_ZThn8_N5test312_GLOBAL__N_11CD1Ev(
+  // CHECK4: getelementptr inbounds i8* {{.*}}, i64 -8
+  // CHECK4: call void @_ZN5test312_GLOBAL__N_11CD2Ev(
+  // CHECK4: ret void
+
+  // CHECK4-LABEL: define internal void @_ZN5test312_GLOBAL__N_11CD2Ev(%"struct.test3::(anonymous namespace)::C"* %this) unnamed_addr
+  // CHECK4: invoke void @_ZN5test31BD2Ev(
+  // CHECK4: call void @_ZN5test31AD2Ev(
+  // CHECK4: ret void
+
+  // CHECK4: declare void @_ZN5test31BD2Ev(
+  // CHECK4: declare void @_ZN5test31AD2Ev(
+
+  // CHECK4-LABEL: define internal void @_ZN5test312_GLOBAL__N_11CD0Ev(%"struct.test3::(anonymous namespace)::C"* %this) unnamed_addr
+  // CHECK4: invoke void @_ZN5test312_GLOBAL__N_11CD2Ev(
+  // CHECK4: call void @_ZdlPv({{.*}}) [[NUW]]
+  // CHECK4: ret void
+  // CHECK4: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
+  // CHECK4-NEXT: cleanup
+  // CHECK4: call void @_ZdlPv({{.*}}) [[NUW]]
+  // CHECK4: resume { i8*, i32 }
+
+  // CHECK4-LABEL: define internal void @_ZThn8_N5test312_GLOBAL__N_11CD0Ev(
+  // CHECK4: getelementptr inbounds i8* {{.*}}, i64 -8
+  // CHECK4: call void @_ZN5test312_GLOBAL__N_11CD0Ev(
+  // CHECK4: ret void
+
+  // CHECK4: attributes [[NUW]] = {{[{].*}} nounwind {{.*[}]}}
 }
 
 namespace test4 {
   struct A { ~A(); };
 
-  // CHECK4-LABEL: define void @_ZN5test43fooEv()
-  // CHECK4: call void @_ZN5test41AD1Ev
-  // CHECK4: ret void
+  // CHECK5-LABEL: define void @_ZN5test43fooEv()
+  // CHECK5: call void @_ZN5test41AD1Ev
+  // CHECK5: ret void
   void foo() {
     {
       A a;
@@ -201,20 +250,20 @@ namespace test4 {
     return;
   }
 
-  // CHECK4-LABEL: define void @_ZN5test43barEi(
-  // CHECK4:      [[X:%.*]] = alloca i32
-  // CHECK4-NEXT: [[A:%.*]] = alloca
-  // CHECK4:      br label
-  // CHECK4:      [[TMP:%.*]] = load i32* [[X]]
-  // CHECK4-NEXT: [[CMP:%.*]] = icmp ne i32 [[TMP]], 0
-  // CHECK4-NEXT: br i1
-  // CHECK4:      call void @_ZN5test41AD1Ev(
-  // CHECK4:      br label
-  // CHECK4:      [[TMP:%.*]] = load i32* [[X]]
-  // CHECK4:      [[TMP2:%.*]] = add nsw i32 [[TMP]], -1
-  // CHECK4:      store i32 [[TMP2]], i32* [[X]]
-  // CHECK4:      br label
-  // CHECK4:      ret void
+  // CHECK5-LABEL: define void @_ZN5test43barEi(
+  // CHECK5:      [[X:%.*]] = alloca i32
+  // CHECK5-NEXT: [[A:%.*]] = alloca
+  // CHECK5:      br label
+  // CHECK5:      [[TMP:%.*]] = load i32* [[X]]
+  // CHECK5-NEXT: [[CMP:%.*]] = icmp ne i32 [[TMP]], 0
+  // CHECK5-NEXT: br i1
+  // CHECK5:      call void @_ZN5test41AD1Ev(
+  // CHECK5:      br label
+  // CHECK5:      [[TMP:%.*]] = load i32* [[X]]
+  // CHECK5:      [[TMP2:%.*]] = add nsw i32 [[TMP]], -1
+  // CHECK5:      store i32 [[TMP2]], i32* [[X]]
+  // CHECK5:      br label
+  // CHECK5:      ret void
   void bar(int x) {
     for (A a; x; ) {
       x--;
@@ -226,27 +275,27 @@ namespace test4 {
 namespace test5 {
   struct A { ~A(); };
 
-  // CHECK4-LABEL: define void @_ZN5test53fooEv()
-  // CHECK4:      [[ELEMS:%.*]] = alloca [5 x [[A:%.*]]], align
-  // CHECK4-NEXT: [[EXN:%.*]] = alloca i8*
-  // CHECK4-NEXT: [[SEL:%.*]] = alloca i32
-  // CHECK4-NEXT: [[BEGIN:%.*]] = getelementptr inbounds [5 x [[A]]]* [[ELEMS]], i32 0, i32 0
-  // CHECK4-NEXT: [[END:%.*]] = getelementptr inbounds [[A]]* [[BEGIN]], i64 5
-  // CHECK4-NEXT: br label
-  // CHECK4:      [[POST:%.*]] = phi [[A]]* [ [[END]], {{%.*}} ], [ [[ELT:%.*]], {{%.*}} ]
-  // CHECK4-NEXT: [[ELT]] = getelementptr inbounds [[A]]* [[POST]], i64 -1
-  // CHECK4-NEXT: invoke void @_ZN5test51AD1Ev([[A]]* [[ELT]])
-  // CHECK4:      [[T0:%.*]] = icmp eq [[A]]* [[ELT]], [[BEGIN]]
-  // CHECK4-NEXT: br i1 [[T0]],
-  // CHECK4:      ret void
+  // CHECK5-LABEL: define void @_ZN5test53fooEv()
+  // CHECK5:      [[ELEMS:%.*]] = alloca [5 x [[A:%.*]]], align
+  // CHECK5-NEXT: [[EXN:%.*]] = alloca i8*
+  // CHECK5-NEXT: [[SEL:%.*]] = alloca i32
+  // CHECK5-NEXT: [[BEGIN:%.*]] = getelementptr inbounds [5 x [[A]]]* [[ELEMS]], i32 0, i32 0
+  // CHECK5-NEXT: [[END:%.*]] = getelementptr inbounds [[A]]* [[BEGIN]], i64 5
+  // CHECK5-NEXT: br label
+  // CHECK5:      [[POST:%.*]] = phi [[A]]* [ [[END]], {{%.*}} ], [ [[ELT:%.*]], {{%.*}} ]
+  // CHECK5-NEXT: [[ELT]] = getelementptr inbounds [[A]]* [[POST]], i64 -1
+  // CHECK5-NEXT: invoke void @_ZN5test51AD1Ev([[A]]* [[ELT]])
+  // CHECK5:      [[T0:%.*]] = icmp eq [[A]]* [[ELT]], [[BEGIN]]
+  // CHECK5-NEXT: br i1 [[T0]],
+  // CHECK5:      ret void
   // lpad
-  // CHECK4:      [[EMPTY:%.*]] = icmp eq [[A]]* [[BEGIN]], [[ELT]]
-  // CHECK4-NEXT: br i1 [[EMPTY]]
-  // CHECK4:      [[AFTER:%.*]] = phi [[A]]* [ [[ELT]], {{%.*}} ], [ [[CUR:%.*]], {{%.*}} ]
-  // CHECK4-NEXT: [[CUR:%.*]] = getelementptr inbounds [[A]]* [[AFTER]], i64 -1
-  // CHECK4-NEXT: invoke void @_ZN5test51AD1Ev([[A]]* [[CUR]])
-  // CHECK4:      [[DONE:%.*]] = icmp eq [[A]]* [[CUR]], [[BEGIN]]
-  // CHECK4-NEXT: br i1 [[DONE]],
+  // CHECK5:      [[EMPTY:%.*]] = icmp eq [[A]]* [[BEGIN]], [[ELT]]
+  // CHECK5-NEXT: br i1 [[EMPTY]]
+  // CHECK5:      [[AFTER:%.*]] = phi [[A]]* [ [[ELT]], {{%.*}} ], [ [[CUR:%.*]], {{%.*}} ]
+  // CHECK5-NEXT: [[CUR:%.*]] = getelementptr inbounds [[A]]* [[AFTER]], i64 -1
+  // CHECK5-NEXT: invoke void @_ZN5test51AD1Ev([[A]]* [[CUR]])
+  // CHECK5:      [[DONE:%.*]] = icmp eq [[A]]* [[CUR]], [[BEGIN]]
+  // CHECK5-NEXT: br i1 [[DONE]],
   void foo() {
     A elems[5];
   }
@@ -265,37 +314,37 @@ namespace test6 {
   };
 
   C::C() { opaque(); }
-  // CHECK4-LABEL: define void @_ZN5test61CC1Ev(%"struct.test6::C"* %this) unnamed_addr
-  // CHECK4:   call void @_ZN5test61BILj2EEC2Ev
-  // CHECK4:   invoke void @_ZN5test61BILj3EEC2Ev
-  // CHECK4:   invoke void @_ZN5test61BILj0EEC2Ev
-  // CHECK4:   invoke void @_ZN5test61BILj1EEC2Ev
-  // CHECK4:   invoke void @_ZN5test66opaqueEv
-  // CHECK4:   ret void
+  // CHECK5-LABEL: define void @_ZN5test61CC1Ev(%"struct.test6::C"* %this) unnamed_addr
+  // CHECK5:   call void @_ZN5test61BILj2EEC2Ev
+  // CHECK5:   invoke void @_ZN5test61BILj3EEC2Ev
+  // CHECK5:   invoke void @_ZN5test61BILj0EEC2Ev
+  // CHECK5:   invoke void @_ZN5test61BILj1EEC2Ev
+  // CHECK5:   invoke void @_ZN5test66opaqueEv
+  // CHECK5:   ret void
   // FIXME: way too much EH cleanup code follows
 
   C::~C() { opaque(); }
-  // CHECK4-LABEL: define void @_ZN5test61CD2Ev(%"struct.test6::C"* %this, i8** %vtt) unnamed_addr
-  // CHECK4:   invoke void @_ZN5test66opaqueEv
-  // CHECK4:   invoke void @_ZN5test61AD1Ev
-  // CHECK4:   invoke void @_ZN5test61AD1Ev
-  // CHECK4:   invoke void @_ZN5test61AD1Ev
-  // CHECK4:   invoke void @_ZN5test61BILj1EED2Ev
-  // CHECK4:   call void @_ZN5test61BILj0EED2Ev
-  // CHECK4:   ret void
-  // CHECK4:   invoke void @_ZN5test61AD1Ev
-  // CHECK4:   invoke void @_ZN5test61AD1Ev
-  // CHECK4:   invoke void @_ZN5test61AD1Ev
-  // CHECK4:   invoke void @_ZN5test61BILj1EED2Ev
-  // CHECK4:   invoke void @_ZN5test61BILj0EED2Ev
-
-  // CHECK4-LABEL: define void @_ZN5test61CD1Ev(%"struct.test6::C"* %this) unnamed_addr
-  // CHECK4:   invoke void @_ZN5test61CD2Ev
-  // CHECK4:   invoke void @_ZN5test61BILj3EED2Ev
-  // CHECK4:   call void @_ZN5test61BILj2EED2Ev
-  // CHECK4:   ret void
-  // CHECK4:   invoke void @_ZN5test61BILj3EED2Ev
-  // CHECK4:   invoke void @_ZN5test61BILj2EED2Ev
+  // CHECK5-LABEL: define void @_ZN5test61CD2Ev(%"struct.test6::C"* %this, i8** %vtt) unnamed_addr
+  // CHECK5:   invoke void @_ZN5test66opaqueEv
+  // CHECK5:   invoke void @_ZN5test61AD1Ev
+  // CHECK5:   invoke void @_ZN5test61AD1Ev
+  // CHECK5:   invoke void @_ZN5test61AD1Ev
+  // CHECK5:   invoke void @_ZN5test61BILj1EED2Ev
+  // CHECK5:   call void @_ZN5test61BILj0EED2Ev
+  // CHECK5:   ret void
+  // CHECK5:   invoke void @_ZN5test61AD1Ev
+  // CHECK5:   invoke void @_ZN5test61AD1Ev
+  // CHECK5:   invoke void @_ZN5test61AD1Ev
+  // CHECK5:   invoke void @_ZN5test61BILj1EED2Ev
+  // CHECK5:   invoke void @_ZN5test61BILj0EED2Ev
+
+  // CHECK5-LABEL: define void @_ZN5test61CD1Ev(%"struct.test6::C"* %this) unnamed_addr
+  // CHECK5:   invoke void @_ZN5test61CD2Ev
+  // CHECK5:   invoke void @_ZN5test61BILj3EED2Ev
+  // CHECK5:   call void @_ZN5test61BILj2EED2Ev
+  // CHECK5:   ret void
+  // CHECK5:   invoke void @_ZN5test61BILj3EED2Ev
+  // CHECK5:   invoke void @_ZN5test61BILj2EED2Ev
 }
 
 // PR 9197
@@ -311,9 +360,9 @@ namespace test7 {
   };
 
   // Verify that this doesn't get emitted as an alias
-  // CHECK4-LABEL: define void @_ZN5test71BD2Ev(
-  // CHECK4:   invoke void @_ZN5test71DD1Ev(
-  // CHECK4:   call void @_ZN5test71AD2Ev(
+  // CHECK5-LABEL: define void @_ZN5test71BD2Ev(
+  // CHECK5:   invoke void @_ZN5test71DD1Ev(
+  // CHECK5:   call void @_ZN5test71AD2Ev(
   B::~B() {}
 }
 
@@ -331,16 +380,16 @@ namespace test8 {
   l: die();
   }
 
-  // CHECK4-LABEL:    define void @_ZN5test84testEv()
-  // CHECK4:      [[X:%.*]] = alloca [[A:%.*]], align 1
-  // CHECK4-NEXT: [[Y:%.*]] = alloca [[A:%.*]], align 1
-  // CHECK4:      call void @_ZN5test81AC1Ev([[A]]* [[X]])
-  // CHECK4-NEXT: br label
-  // CHECK4:      invoke void @_ZN5test81AC1Ev([[A]]* [[Y]])
-  // CHECK4:      invoke void @_ZN5test81AD1Ev([[A]]* [[Y]])
-  // CHECK4-NOT:  switch
-  // CHECK4:      invoke void @_ZN5test83dieEv()
-  // CHECK4:      unreachable
+  // CHECK5-LABEL:    define void @_ZN5test84testEv()
+  // CHECK5:      [[X:%.*]] = alloca [[A:%.*]], align 1
+  // CHECK5-NEXT: [[Y:%.*]] = alloca [[A:%.*]], align 1
+  // CHECK5:      call void @_ZN5test81AC1Ev([[A]]* [[X]])
+  // CHECK5-NEXT: br label
+  // CHECK5:      invoke void @_ZN5test81AC1Ev([[A]]* [[Y]])
+  // CHECK5:      invoke void @_ZN5test81AD1Ev([[A]]* [[Y]])
+  // CHECK5-NOT:  switch
+  // CHECK5:      invoke void @_ZN5test83dieEv()
+  // CHECK5:      unreachable
 }
 
 // PR12710
@@ -355,8 +404,8 @@ namespace test9 {
     f1<int>();
     f2();
   }
-  // CHECK4: call void @_ZN5test97ArgTypeD1Ev(%"struct.test9::ArgType"* %
-  // CHECK4: call void @_ZN5test92f2Ev()
+  // CHECK5: call void @_ZN5test97ArgTypeD1Ev(%"struct.test9::ArgType"* %
+  // CHECK5: call void @_ZN5test92f2Ev()
 }
 
 namespace test10 {
@@ -367,60 +416,10 @@ namespace test10 {
   };
   template <class DataType> class opt : public Option {};
   template class opt<int>;
-  // CHECK4-LABEL: define zeroext i1 @_ZN6test1016handleOccurrenceEv(
+  // CHECK5-LABEL: define zeroext i1 @_ZN6test1016handleOccurrenceEv(
   bool handleOccurrence() {
-    // CHECK4: call void @_ZN6test106OptionD2Ev(
+    // CHECK5: call void @_ZN6test106OptionD2Ev(
     Option x;
     return true;
   }
 }
-
-// Checks from test3:
-
-  // CHECK4-LABEL: define internal void @_ZN5test312_GLOBAL__N_11DD0Ev(%"struct.test3::(anonymous namespace)::D"* %this) unnamed_addr
-  // CHECK4: invoke void {{.*}} @_ZN5test312_GLOBAL__N_11CD2Ev
-  // CHECK4: call void @_ZdlPv({{.*}}) [[NUW:#[0-9]+]]
-  // CHECK4: ret void
-  // CHECK4: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
-  // CHECK4-NEXT: cleanup
-  // CHECK4: call void @_ZdlPv({{.*}}) [[NUW]]
-  // CHECK4: resume { i8*, i32 }
-
-  // CHECK4-LABEL: define internal void @_ZThn8_N5test312_GLOBAL__N_11DD1Ev(
-  // CHECK4: getelementptr inbounds i8* {{.*}}, i64 -8
-  // CHECK4: call void {{.*}} @_ZN5test312_GLOBAL__N_11CD2Ev
-  // CHECK4: ret void
-
-  // CHECK4-LABEL: define internal void @_ZThn8_N5test312_GLOBAL__N_11DD0Ev(
-  // CHECK4: getelementptr inbounds i8* {{.*}}, i64 -8
-  // CHECK4: call void @_ZN5test312_GLOBAL__N_11DD0Ev(
-  // CHECK4: ret void
-
-  // CHECK4-LABEL: define internal void @_ZThn8_N5test312_GLOBAL__N_11CD1Ev(
-  // CHECK4: getelementptr inbounds i8* {{.*}}, i64 -8
-  // CHECK4: call void @_ZN5test312_GLOBAL__N_11CD2Ev(
-  // CHECK4: ret void
-
-  // CHECK4-LABEL: define internal void @_ZN5test312_GLOBAL__N_11CD2Ev(%"struct.test3::(anonymous namespace)::C"* %this) unnamed_addr
-  // CHECK4: invoke void @_ZN5test31BD2Ev(
-  // CHECK4: call void @_ZN5test31AD2Ev(
-  // CHECK4: ret void
-
-  // CHECK4: declare void @_ZN5test31BD2Ev(
-  // CHECK4: declare void @_ZN5test31AD2Ev(
-
-  // CHECK4-LABEL: define internal void @_ZN5test312_GLOBAL__N_11CD0Ev(%"struct.test3::(anonymous namespace)::C"* %this) unnamed_addr
-  // CHECK4: invoke void @_ZN5test312_GLOBAL__N_11CD2Ev(
-  // CHECK4: call void @_ZdlPv({{.*}}) [[NUW]]
-  // CHECK4: ret void
-  // CHECK4: landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
-  // CHECK4-NEXT: cleanup
-  // CHECK4: call void @_ZdlPv({{.*}}) [[NUW]]
-  // CHECK4: resume { i8*, i32 }
-
-  // CHECK4-LABEL: define internal void @_ZThn8_N5test312_GLOBAL__N_11CD0Ev(
-  // CHECK4: getelementptr inbounds i8* {{.*}}, i64 -8
-  // CHECK4: call void @_ZN5test312_GLOBAL__N_11CD0Ev(
-  // CHECK4: ret void
-
-  // CHECK4: attributes [[NUW]] = {{[{].*}} nounwind {{.*[}]}}





More information about the cfe-commits mailing list