llvm.org GIT mirror llvm / 9426caa
Check that the right eh personality function is used. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36788 91177308-0d34-0410-b5e6-96231b3b80d8 Duncan Sands 13 years ago
1 changed file(s) with 35 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 ; RUN: llvm-as < %s | llc -march=x86 -enable-eh -o - | grep zPLR
1
2 @error = external global i8 ; [#uses=2]
3
4 define void @_ada_x() {
5 entry:
6 invoke void @raise( )
7 to label %eh_then unwind label %unwind
8
9 unwind: ; preds = %entry
10 %eh_ptr = tail call i8* @llvm.eh.exception( ) ; [#uses=2]
11 %eh_select = tail call i32 (i8*, i8*, ...)* @llvm.eh.selector( i8* %eh_ptr, i8* bitcast (i32 (...)* @__gnat_eh_personality to i8*), i8* @error ) ; [#uses=1]
12 %eh_typeid = tail call i32 @llvm.eh.typeid.for( i8* @error ) ; [#uses=1]
13 %tmp2 = icmp eq i32 %eh_select, %eh_typeid ; [#uses=1]
14 br i1 %tmp2, label %eh_then, label %Unwind
15
16 eh_then: ; preds = %unwind, %entry
17 ret void
18
19 Unwind: ; preds = %unwind
20 tail call i32 (...)* @_Unwind_Resume( i8* %eh_ptr ) ; :0 [#uses=0]
21 unreachable
22 }
23
24 declare void @raise()
25
26 declare i8* @llvm.eh.exception()
27
28 declare i32 @llvm.eh.selector(i8*, i8*, ...)
29
30 declare i32 @llvm.eh.typeid.for(i8*)
31
32 declare i32 @__gnat_eh_personality(...)
33
34 declare i32 @_Unwind_Resume(...)