1 ; RUN: llvm-as %s -o %t.bc
2 ; RUN: lli -march=x86-64 %t.bc > /dev/null
5 %struct.__fundamental_type_info_pseudo = type { %struct.__type_info_pseudo }
6 %struct.__type_info_pseudo = type { i8*, i8* }
8 @_ZTIi = external constant %struct.__fundamental_type_info_pseudo ; <%struct.__fundamental_type_info_pseudo*> [#uses=1]
9 @.str = private constant [3 x i8] c"ok\00", align 1 ; <[3 x i8]*> [#uses=1]
11 define i32 @main() ssp {
13 %retval = alloca i32 ; <i32*> [#uses=2]
14 %save_filt.5 = alloca i32 ; <i32*> [#uses=2]
15 %save_eptr.4 = alloca i8* ; <i8**> [#uses=2]
16 %0 = alloca i32 ; <i32*> [#uses=2]
17 %eh_exception = alloca i8* ; <i8**> [#uses=10]
18 %eh_selector = alloca i32 ; <i32*> [#uses=5]
19 %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
20 invoke void @_ZL3foov() ssp
21 to label %invcont unwind label %lpad
23 invcont: ; preds = %entry
27 %eh_value = load i8** %eh_exception ; <i8*> [#uses=1]
28 %1 = call i8* @__cxa_begin_catch(i8* %eh_value) nounwind ; <i8*> [#uses=0]
29 %2 = invoke i32 @puts(i8* getelementptr inbounds ([3 x i8]* @.str, i32 0, i32 0))
30 to label %invcont1 unwind label %lpad10 ; <i32> [#uses=0]
32 invcont1: ; preds = %bb
33 call void @__cxa_end_catch()
36 bb2: ; preds = %ppad18
37 %eh_select = load i32* %eh_selector ; <i32> [#uses=1]
38 store i32 %eh_select, i32* %save_filt.5, align 4
39 %eh_value3 = load i8** %eh_exception ; <i8*> [#uses=1]
40 store i8* %eh_value3, i8** %save_eptr.4, align 4
41 invoke void @__cxa_end_catch()
42 to label %invcont4 unwind label %lpad14
44 invcont4: ; preds = %bb2
45 %3 = load i8** %save_eptr.4, align 4 ; <i8*> [#uses=1]
46 store i8* %3, i8** %eh_exception, align 4
47 %4 = load i32* %save_filt.5, align 4 ; <i32> [#uses=1]
48 store i32 %4, i32* %eh_selector, align 4
51 bb5: ; preds = %ppad19
52 call void @_ZSt9terminatev() noreturn nounwind
55 bb6: ; preds = %invcont1, %invcont
56 store i32 0, i32* %0, align 4
57 %5 = load i32* %0, align 4 ; <i32> [#uses=1]
58 store i32 %5, i32* %retval, align 4
61 return: ; preds = %bb6
62 %retval7 = load i32* %retval ; <i32> [#uses=1]
65 lpad: ; preds = %entry
66 %eh_ptr = call i8* @llvm.eh.exception() ; <i8*> [#uses=1]
67 store i8* %eh_ptr, i8** %eh_exception
68 %eh_ptr8 = load i8** %eh_exception ; <i8*> [#uses=1]
69 %eh_select9 = call i32 (i8*, i8*, ...)* @llvm.eh.selector.i32(i8* %eh_ptr8, i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*), i8* null) ; <i32> [#uses=1]
70 store i32 %eh_select9, i32* %eh_selector
74 %eh_ptr11 = call i8* @llvm.eh.exception() ; <i8*> [#uses=1]
75 store i8* %eh_ptr11, i8** %eh_exception
76 %eh_ptr12 = load i8** %eh_exception ; <i8*> [#uses=1]
77 %eh_select13 = call i32 (i8*, i8*, ...)* @llvm.eh.selector.i32(i8* %eh_ptr12, i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*), i8* null) ; <i32> [#uses=1]
78 store i32 %eh_select13, i32* %eh_selector
81 lpad14: ; preds = %bb2
82 %eh_ptr15 = call i8* @llvm.eh.exception() ; <i8*> [#uses=1]
83 store i8* %eh_ptr15, i8** %eh_exception
84 %eh_ptr16 = load i8** %eh_exception ; <i8*> [#uses=1]
85 %eh_select17 = call i32 (i8*, i8*, ...)* @llvm.eh.selector.i32(i8* %eh_ptr16, i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*), i32 1) ; <i32> [#uses=1]
86 store i32 %eh_select17, i32* %eh_selector
92 ppad18: ; preds = %lpad10
95 ppad19: ; preds = %lpad14
98 Unwind: ; preds = %invcont4
99 %eh_ptr20 = load i8** %eh_exception ; <i8*> [#uses=1]
100 call void @_Unwind_Resume_or_Rethrow(i8* %eh_ptr20)
104 define internal void @_ZL3foov() ssp {
106 %0 = alloca i8* ; <i8**> [#uses=3]
107 %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
108 %1 = call i8* @__cxa_allocate_exception(i32 4) nounwind ; <i8*> [#uses=1]
109 store i8* %1, i8** %0, align 4
110 %2 = load i8** %0, align 4 ; <i8*> [#uses=1]
111 %3 = bitcast i8* %2 to i32* ; <i32*> [#uses=1]
112 store i32 42, i32* %3, align 4
113 %4 = load i8** %0, align 4 ; <i8*> [#uses=1]
114 call void @__cxa_throw(i8* %4, i8* bitcast (%struct.__fundamental_type_info_pseudo* @_ZTIi to i8*), void (i8*)* null) noreturn
117 return: ; No predecessors!
121 declare i8* @__cxa_allocate_exception(i32) nounwind
123 declare void @__cxa_throw(i8*, i8*, void (i8*)*) noreturn
125 declare i8* @__cxa_begin_catch(i8*) nounwind
127 declare i8* @llvm.eh.exception() nounwind
129 declare i32 @llvm.eh.selector.i32(i8*, i8*, ...) nounwind
131 declare i32 @llvm.eh.typeid.for.i32(i8*) nounwind
133 declare i32 @puts(i8*)
135 declare void @__cxa_end_catch()
137 declare void @_ZSt9terminatev() noreturn nounwind
139 declare i32 @__gxx_personality_v0(...)
141 declare void @_Unwind_Resume_or_Rethrow(i8*)