diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2013-12-09 14:51:17 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2013-12-09 14:51:17 +0000 |
commit | d6c0a824b6fdaffd12cf64ee136973278ae20c08 (patch) | |
tree | afb8ed3c1c78bad75fc1b51e6148d15a069711f6 /test/CodeGenCXX/static-init.cpp | |
parent | 9c009bca6da945074f0d5d496bd87da13e20eaea (diff) |
Output destructors and constructors in a more natural order.
With this patch we output the in the order
C2
C1
D2
D1
D0
Which means that a destructor or constructor that call another is output after
the callee. This is a bit easier to read IHMO and a tiny bit more efficient
as we don't put a decl in DeferredDeclsToEmit.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196784 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/static-init.cpp')
-rw-r--r-- | test/CodeGenCXX/static-init.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/test/CodeGenCXX/static-init.cpp b/test/CodeGenCXX/static-init.cpp index f522775c10..d23ead47f3 100644 --- a/test/CodeGenCXX/static-init.cpp +++ b/test/CodeGenCXX/static-init.cpp @@ -103,14 +103,14 @@ namespace test2 { B::B() { static int x = foo(); } - // CHECK-LABEL: define void @_ZN5test21BC1Ev + // CHECK-LABEL: define void @_ZN5test21BC2Ev // CHECK: load atomic i8* bitcast (i64* @_ZGVZN5test21BC1EvE1x to i8*) acquire, // CHECK: call i32 @__cxa_guard_acquire(i64* @_ZGVZN5test21BC1EvE1x) // CHECK: [[T0:%.*]] = call i32 @_ZN5test23fooEv() // CHECK: store i32 [[T0]], i32* @_ZZN5test21BC1EvE1x, // CHECK: call void @__cxa_guard_release(i64* @_ZGVZN5test21BC1EvE1x) - // CHECK-LABEL: define void @_ZN5test21BC2Ev + // CHECK-LABEL: define void @_ZN5test21BC1Ev // CHECK: load atomic i8* bitcast (i64* @_ZGVZN5test21BC1EvE1x to i8*) acquire, // CHECK: call i32 @__cxa_guard_acquire(i64* @_ZGVZN5test21BC1EvE1x) // CHECK: [[T0:%.*]] = call i32 @_ZN5test23fooEv() @@ -122,15 +122,15 @@ namespace test2 { B::~B() { static int y = foo(); } - // CHECK-LABEL: define void @_ZN5test21BD1Ev( - // CHECK: call void @_ZN5test21BD2Ev( - // CHECK-LABEL: define void @_ZN5test21BD2Ev( // CHECK: load atomic i8* bitcast (i64* @_ZGVZN5test21BD1EvE1y to i8*) acquire, // CHECK: call i32 @__cxa_guard_acquire(i64* @_ZGVZN5test21BD1EvE1y) // CHECK: [[T0:%.*]] = call i32 @_ZN5test23fooEv() // CHECK: store i32 [[T0]], i32* @_ZZN5test21BD1EvE1y, // CHECK: call void @__cxa_guard_release(i64* @_ZGVZN5test21BD1EvE1y) + + // CHECK-LABEL: define void @_ZN5test21BD1Ev( + // CHECK: call void @_ZN5test21BD2Ev( } // This shouldn't error out. @@ -149,6 +149,6 @@ namespace test3 { union U { char x; int i; }; static U u = { 'a' }; } - // CHECK-LABEL: define void @_ZN5test31BC1Ev( // CHECK-LABEL: define void @_ZN5test31BC2Ev( + // CHECK-LABEL: define void @_ZN5test31BC1Ev( } |