diff options
author | Anders Carlsson <andersca@mac.com> | 2009-12-11 00:32:37 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2009-12-11 00:32:37 +0000 |
commit | afd1edb52efbc7f981320c90910e8c0562702092 (patch) | |
tree | 9b0421b4de88cfb48abd38d5ec14051b0010b3db /clang/test/CodeGenCXX/eh.cpp | |
parent | ff141799fbbb573d35b2066fd75fcf1340a6c7d7 (diff) | |
download | bcm5719-llvm-afd1edb52efbc7f981320c90910e8c0562702092.tar.gz bcm5719-llvm-afd1edb52efbc7f981320c90910e8c0562702092.zip |
When an exception needs to be freed by calling __cxa_exception_free, make sure to stash away the exception pointer somewhere.
This fixes an "Instruction does not dominate all uses!" verification error when compiling TableGen.
llvm-svn: 91084
Diffstat (limited to 'clang/test/CodeGenCXX/eh.cpp')
-rw-r--r-- | clang/test/CodeGenCXX/eh.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/eh.cpp b/clang/test/CodeGenCXX/eh.cpp index ec457dd4187..5570fb44c24 100644 --- a/clang/test/CodeGenCXX/eh.cpp +++ b/clang/test/CodeGenCXX/eh.cpp @@ -11,7 +11,9 @@ void test1() { // CHECK: define void @_Z5test1v() nounwind { // CHECK-NEXT:entry: +// CHECK-NEXT: %exception.ptr = alloca i8* // CHECK-NEXT: %exception = call i8* @__cxa_allocate_exception(i64 8) +// CHECK-NEXT: store i8* %exception, i8** %exception.ptr // CHECK-NEXT: %0 = bitcast i8* %exception to %struct.test1_D* // CHECK-NEXT: %tmp = bitcast %struct.test1_D* %0 to i8* // CHECK-NEXT: call void @llvm.memcpy.i64(i8* %tmp, i8* bitcast (%struct.test1_D* @d1 to i8*), i64 8, i32 8) @@ -32,7 +34,9 @@ void test2() { // CHECK: define void @_Z5test2v() nounwind { // CHECK-NEXT:entry: +// CHECK-NEXT: %exception.ptr = alloca i8* // CHECK-NEXT: %exception = call i8* @__cxa_allocate_exception(i64 16) +// CHECK-NEXT: store i8* %exception, i8** %exception.ptr // CHECK-NEXT: %0 = bitcast i8* %exception to %struct.test2_D* // CHECK: invoke void @_ZN7test2_DC1ERKS_(%struct.test2_D* %0, %struct.test2_D* @d2) // CHECK-NEXT: to label %invoke.cont unwind label %terminate.handler @@ -52,7 +56,9 @@ void test3() { // CHECK: define void @_Z5test3v() nounwind { // CHECK-NEXT: entry: +// CHECK-NEXT: %exception.ptr = alloca i8* // CHECK-NEXT: %exception = call i8* @__cxa_allocate_exception(i64 8) +// CHECK-NEXT: store i8* %exception, i8** %exception.ptr // CHECK-NEXT: %0 = bitcast i8* %exception to %struct.test3_D** // CHECK-NEXT: store %struct.test3_D* null, %struct.test3_D** %0 // CHECK-NEXT: call void @__cxa_throw(i8* %exception, i8* bitcast (%1* @_ZTIPV7test3_D to i8*), i8* null) noreturn |