summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/destructors.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2011-07-11 08:38:19 +0000
committerJohn McCall <rjmccall@apple.com>2011-07-11 08:38:19 +0000
commit178360e1cd7ea8606f1b9673485f7d76dc3c458b (patch)
tree6fd0ba90236f1ae07be7b7e36a21549bef59675d /clang/test/CodeGenCXX/destructors.cpp
parent61715740cd4f6fb0dc645b26028392f104fd59c9 (diff)
downloadbcm5719-llvm-178360e1cd7ea8606f1b9673485f7d76dc3c458b.tar.gz
bcm5719-llvm-178360e1cd7ea8606f1b9673485f7d76dc3c458b.zip
Fix a lot of problems with the partial destruction of arrays:
- an off-by-one error in emission of irregular array limits for InitListExprs - use an EH partial-destruction cleanup within the normal array-destruction cleanup - get the branch destinations right for the empty check Also some refactoring which unfortunately obscures these changes. llvm-svn: 134890
Diffstat (limited to 'clang/test/CodeGenCXX/destructors.cpp')
-rw-r--r--clang/test/CodeGenCXX/destructors.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/clang/test/CodeGenCXX/destructors.cpp b/clang/test/CodeGenCXX/destructors.cpp
index 5e14cbef897..33819858149 100644
--- a/clang/test/CodeGenCXX/destructors.cpp
+++ b/clang/test/CodeGenCXX/destructors.cpp
@@ -235,15 +235,26 @@ namespace test5 {
// CHECK: define void @_ZN5test53fooEv()
// CHECK: [[ELEMS:%.*]] = alloca [5 x [[A:%.*]]], align
+ // CHECK-NEXT: [[EXN:%.*]] = alloca i8*
+ // CHECK-NEXT: [[SEL:%.*]] = alloca i32
+ // CHECK-NEXT: [[EHCLEANUP:%.*]] = alloca i32
// CHECK-NEXT: [[BEGIN:%.*]] = getelementptr inbounds [5 x [[A]]]* [[ELEMS]], i32 0, i32 0
// CHECK-NEXT: [[END:%.*]] = getelementptr inbounds [[A]]* [[BEGIN]], i64 5
// CHECK-NEXT: br label
// CHECK: [[POST:%.*]] = phi [[A]]* [ [[END]], {{%.*}} ], [ [[ELT:%.*]], {{%.*}} ]
// CHECK-NEXT: [[ELT]] = getelementptr inbounds [[A]]* [[POST]], i64 -1
- // CHECK-NEXT: call void @_ZN5test51AD1Ev([[A]]* [[ELT]])
- // CHECK-NEXT: [[T0:%.*]] = icmp eq [[A]]* [[ELT]], [[BEGIN]]
+ // CHECK-NEXT: invoke void @_ZN5test51AD1Ev([[A]]* [[ELT]])
+ // CHECK: [[T0:%.*]] = icmp eq [[A]]* [[ELT]], [[BEGIN]]
// CHECK-NEXT: br i1 [[T0]],
// CHECK: ret void
+ // lpad
+ // CHECK: [[EMPTY:%.*]] = icmp eq [[A]]* [[BEGIN]], [[ELT]]
+ // CHECK-NEXT: br i1 [[EMPTY]]
+ // CHECK: [[AFTER:%.*]] = phi [[A]]* [ [[ELT]], {{%.*}} ], [ [[CUR:%.*]], {{%.*}} ]
+ // CHECK-NEXT: [[CUR:%.*]] = getelementptr inbounds [[A]]* [[AFTER]], i64 -1
+ // CHECK-NEXT: invoke void @_ZN5test51AD1Ev([[A]]* [[CUR]])
+ // CHECK: [[DONE:%.*]] = icmp eq [[A]]* [[CUR]], [[BEGIN]]
+ // CHECK-NEXT: br i1 [[DONE]],
void foo() {
A elems[5];
}
OpenPOWER on IntegriCloud