diff options
| author | Duncan Sands <baldrick@free.fr> | 2007-05-05 20:22:08 +0000 |
|---|---|---|
| committer | Duncan Sands <baldrick@free.fr> | 2007-05-05 20:22:08 +0000 |
| commit | d31dcdacef43e6488ee08a9e668da0a92764f742 (patch) | |
| tree | 22d54772d14a7cf5244ebe766a02a58d4152eefe /llvm/test/CodeGen/Generic/2007-05-05-Personality.ll | |
| parent | 07e6f3257c703d2388d3dafa606734538e87b4ed (diff) | |
| download | bcm5719-llvm-d31dcdacef43e6488ee08a9e668da0a92764f742.tar.gz bcm5719-llvm-d31dcdacef43e6488ee08a9e668da0a92764f742.zip | |
Check that the right eh personality function is used.
llvm-svn: 36788
Diffstat (limited to 'llvm/test/CodeGen/Generic/2007-05-05-Personality.ll')
| -rw-r--r-- | llvm/test/CodeGen/Generic/2007-05-05-Personality.ll | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/Generic/2007-05-05-Personality.ll b/llvm/test/CodeGen/Generic/2007-05-05-Personality.ll new file mode 100644 index 00000000000..f2ad6df7feb --- /dev/null +++ b/llvm/test/CodeGen/Generic/2007-05-05-Personality.ll @@ -0,0 +1,35 @@ +; RUN: llvm-as < %s | llc -march=x86 -enable-eh -o - | grep zPLR + +@error = external global i8 ; <i8*> [#uses=2] + +define void @_ada_x() { +entry: + invoke void @raise( ) + to label %eh_then unwind label %unwind + +unwind: ; preds = %entry + %eh_ptr = tail call i8* @llvm.eh.exception( ) ; <i8*> [#uses=2] + %eh_select = tail call i32 (i8*, i8*, ...)* @llvm.eh.selector( i8* %eh_ptr, i8* bitcast (i32 (...)* @__gnat_eh_personality to i8*), i8* @error ) ; <i32> [#uses=1] + %eh_typeid = tail call i32 @llvm.eh.typeid.for( i8* @error ) ; <i32> [#uses=1] + %tmp2 = icmp eq i32 %eh_select, %eh_typeid ; <i1> [#uses=1] + br i1 %tmp2, label %eh_then, label %Unwind + +eh_then: ; preds = %unwind, %entry + ret void + +Unwind: ; preds = %unwind + tail call i32 (...)* @_Unwind_Resume( i8* %eh_ptr ) ; <i32>:0 [#uses=0] + unreachable +} + +declare void @raise() + +declare i8* @llvm.eh.exception() + +declare i32 @llvm.eh.selector(i8*, i8*, ...) + +declare i32 @llvm.eh.typeid.for(i8*) + +declare i32 @__gnat_eh_personality(...) + +declare i32 @_Unwind_Resume(...) |

