blob: a016809857e7f597c6f54a9639c8ccc93a651435 [file] [log] [blame]
Dan Gohman55a78772009-09-11 18:41:06 +00001; RUN: llc < %s -mtriple=arm-apple-darwin9 -march=arm | FileCheck %s
Jim Grosbach3fb2b1e2009-09-01 01:57:56 +00002
Chris Lattnerb85e4eb2011-06-18 06:05:24 +00003; CHECK: L_LSDA_0:
4
5
Jim Grosbach3fb2b1e2009-09-01 01:57:56 +00006%struct.A = type { i32* }
7
Rafael Espindola1e819662010-06-17 15:18:27 +00008define void @"\01-[MyFunction Name:]"() {
Jim Grosbach3fb2b1e2009-09-01 01:57:56 +00009entry:
Chris Lattnerb85e4eb2011-06-18 06:05:24 +000010 %save_filt.1 = alloca i32
11 %save_eptr.0 = alloca i8*
12 %a = alloca %struct.A
13 %eh_exception = alloca i8*
14 %eh_selector = alloca i32
15 %"alloca point" = bitcast i32 0 to i32
16 call void @_ZN1AC1Ev(%struct.A* %a)
17 invoke void @_Z3barv()
Jim Grosbach3fb2b1e2009-09-01 01:57:56 +000018 to label %invcont unwind label %lpad
19
20invcont: ; preds = %entry
Chris Lattnerb85e4eb2011-06-18 06:05:24 +000021 call void @_ZN1AD1Ev(%struct.A* %a) nounwind
Jim Grosbach3fb2b1e2009-09-01 01:57:56 +000022 br label %return
23
24bb: ; preds = %ppad
Chris Lattnerb85e4eb2011-06-18 06:05:24 +000025 %eh_select = load i32* %eh_selector
Jim Grosbach3fb2b1e2009-09-01 01:57:56 +000026 store i32 %eh_select, i32* %save_filt.1, align 4
Chris Lattnerb85e4eb2011-06-18 06:05:24 +000027 %eh_value = load i8** %eh_exception
Jim Grosbach3fb2b1e2009-09-01 01:57:56 +000028 store i8* %eh_value, i8** %save_eptr.0, align 4
Chris Lattnerb85e4eb2011-06-18 06:05:24 +000029 call void @_ZN1AD1Ev(%struct.A* %a) nounwind
30 %0 = load i8** %save_eptr.0, align 4
Jim Grosbach3fb2b1e2009-09-01 01:57:56 +000031 store i8* %0, i8** %eh_exception, align 4
Chris Lattnerb85e4eb2011-06-18 06:05:24 +000032 %1 = load i32* %save_filt.1, align 4
Jim Grosbach3fb2b1e2009-09-01 01:57:56 +000033 store i32 %1, i32* %eh_selector, align 4
34 br label %Unwind
35
36return: ; preds = %invcont
37 ret void
38
39lpad: ; preds = %entry
Bill Wendling30ceba32011-11-08 00:09:27 +000040 %exn = landingpad {i8*, i32} personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*)
41 cleanup
42 %eh_ptr = extractvalue {i8*, i32} %exn, 0
Jim Grosbach3fb2b1e2009-09-01 01:57:56 +000043 store i8* %eh_ptr, i8** %eh_exception
Bill Wendling30ceba32011-11-08 00:09:27 +000044 %eh_select2 = extractvalue {i8*, i32} %exn, 1
Jim Grosbach3fb2b1e2009-09-01 01:57:56 +000045 store i32 %eh_select2, i32* %eh_selector
46 br label %ppad
47
48ppad: ; preds = %lpad
49 br label %bb
50
51Unwind: ; preds = %bb
Chris Lattnerb85e4eb2011-06-18 06:05:24 +000052 %eh_ptr3 = load i8** %eh_exception
53 call void @_Unwind_SjLj_Resume(i8* %eh_ptr3)
Jim Grosbach3fb2b1e2009-09-01 01:57:56 +000054 unreachable
55}
56
Rafael Espindola1e819662010-06-17 15:18:27 +000057define linkonce_odr void @_ZN1AC1Ev(%struct.A* %this) {
Jim Grosbach3fb2b1e2009-09-01 01:57:56 +000058entry:
Chris Lattnerb85e4eb2011-06-18 06:05:24 +000059 %this_addr = alloca %struct.A*
60 %"alloca point" = bitcast i32 0 to i32
Jim Grosbach3fb2b1e2009-09-01 01:57:56 +000061 store %struct.A* %this, %struct.A** %this_addr
Chris Lattnerb85e4eb2011-06-18 06:05:24 +000062 %0 = call i8* @_Znwm(i32 4)
63 %1 = bitcast i8* %0 to i32*
64 %2 = load %struct.A** %this_addr, align 4
65 %3 = getelementptr inbounds %struct.A* %2, i32 0, i32 0
Jim Grosbach3fb2b1e2009-09-01 01:57:56 +000066 store i32* %1, i32** %3, align 4
67 br label %return
68
69return: ; preds = %entry
70 ret void
71}
72
Rafael Espindola1e819662010-06-17 15:18:27 +000073declare i8* @_Znwm(i32)
Jim Grosbach3fb2b1e2009-09-01 01:57:56 +000074
Rafael Espindola1e819662010-06-17 15:18:27 +000075define linkonce_odr void @_ZN1AD1Ev(%struct.A* %this) nounwind {
Jim Grosbach3fb2b1e2009-09-01 01:57:56 +000076entry:
Chris Lattnerb85e4eb2011-06-18 06:05:24 +000077 %this_addr = alloca %struct.A*
78 %"alloca point" = bitcast i32 0 to i32
Jim Grosbach3fb2b1e2009-09-01 01:57:56 +000079 store %struct.A* %this, %struct.A** %this_addr
Chris Lattnerb85e4eb2011-06-18 06:05:24 +000080 %0 = load %struct.A** %this_addr, align 4
81 %1 = getelementptr inbounds %struct.A* %0, i32 0, i32 0
82 %2 = load i32** %1, align 4
83 %3 = bitcast i32* %2 to i8*
84 call void @_ZdlPv(i8* %3) nounwind
Jim Grosbach3fb2b1e2009-09-01 01:57:56 +000085 br label %bb
86
87bb: ; preds = %entry
88 br label %return
89
90return: ; preds = %bb
91 ret void
92}
Jim Grosbach3fb2b1e2009-09-01 01:57:56 +000093
Rafael Espindola1e819662010-06-17 15:18:27 +000094declare void @_ZdlPv(i8*) nounwind
Jim Grosbach3fb2b1e2009-09-01 01:57:56 +000095
Rafael Espindola1e819662010-06-17 15:18:27 +000096declare void @_Z3barv()
Jim Grosbach3fb2b1e2009-09-01 01:57:56 +000097
Chris Lattnerb85e4eb2011-06-18 06:05:24 +000098declare i32 @llvm.eh.typeid.for(i8*) nounwind
Jim Grosbach3fb2b1e2009-09-01 01:57:56 +000099
Rafael Espindola1e819662010-06-17 15:18:27 +0000100declare i32 @__gxx_personality_sj0(...)
Jim Grosbach3fb2b1e2009-09-01 01:57:56 +0000101
Rafael Espindola1e819662010-06-17 15:18:27 +0000102declare void @_Unwind_SjLj_Resume(i8*)