Mercurial > hg > CbC > CbC_llvm
comparison test/CodeGen/X86/funclet-layout.ll @ 100:7d135dc70f03 LLVM 3.9
LLVM 3.9
author | Miyagi Mitsuki <e135756@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 26 Jan 2016 22:53:40 +0900 |
parents | afa8332a0e37 |
children |
comparison
equal
deleted
inserted
replaced
96:6418606d0ead | 100:7d135dc70f03 |
---|---|
13 entry: | 13 entry: |
14 invoke void @g() | 14 invoke void @g() |
15 to label %unreachable unwind label %catch.dispatch | 15 to label %unreachable unwind label %catch.dispatch |
16 | 16 |
17 catch.dispatch: | 17 catch.dispatch: |
18 %cp = catchpad [i8* null, i32 64, i8* null] | 18 %cs1 = catchswitch within none [label %catch] unwind to caller |
19 to label %catch unwind label %catchendblock | |
20 | 19 |
21 catch: | 20 catch: |
22 br i1 %B, label %catchret, label %catch | 21 %cp = catchpad within %cs1 [i8* null, i32 64, i8* null] |
22 br label %catch.loop | |
23 | |
24 catch.loop: | |
25 br i1 %B, label %catchret, label %catch.loop | |
23 | 26 |
24 catchret: | 27 catchret: |
25 catchret %cp to label %try.cont | 28 catchret from %cp to label %try.cont |
26 | 29 |
27 try.cont: | 30 try.cont: |
28 ret void | 31 ret void |
29 | |
30 catchendblock: | |
31 catchendpad unwind to caller | |
32 | 32 |
33 unreachable: | 33 unreachable: |
34 unreachable | 34 unreachable |
35 } | 35 } |
36 | 36 |
53 entry: | 53 entry: |
54 invoke void @_CxxThrowException(i8* null, %eh.ThrowInfo* null) #1 | 54 invoke void @_CxxThrowException(i8* null, %eh.ThrowInfo* null) #1 |
55 to label %unreachable unwind label %catch.dispatch | 55 to label %unreachable unwind label %catch.dispatch |
56 | 56 |
57 catch.dispatch: ; preds = %entry | 57 catch.dispatch: ; preds = %entry |
58 %0 = catchpad [i8* null, i32 64, i8* null] | 58 %cs1 = catchswitch within none [label %catch] unwind to caller |
59 to label %catch unwind label %catchendblock | |
60 | 59 |
61 catch: ; preds = %catch.dispatch | 60 catch: ; preds = %catch.dispatch |
62 invoke void @_CxxThrowException(i8* null, %eh.ThrowInfo* null) #1 | 61 %0 = catchpad within %cs1 [i8* null, i32 64, i8* null] |
62 invoke void @_CxxThrowException(i8* null, %eh.ThrowInfo* null) #1 ["funclet"(token %0)] | |
63 to label %unreachable unwind label %catch.dispatch.1 | 63 to label %unreachable unwind label %catch.dispatch.1 |
64 | 64 |
65 catch.dispatch.1: ; preds = %catch | 65 catch.dispatch.1: ; preds = %catch |
66 %1 = catchpad [i8* null, i32 64, i8* null] | 66 %cs2 = catchswitch within %0 [label %catch.3] unwind to caller |
67 to label %catch.3 unwind label %catchendblock.2 | |
68 | 67 |
69 catch.3: ; preds = %catch.dispatch.1 | 68 catch.3: ; preds = %catch.dispatch.1 |
70 catchret %1 to label %try.cont | 69 %1 = catchpad within %cs2 [i8* null, i32 64, i8* null] |
70 catchret from %1 to label %try.cont | |
71 | 71 |
72 try.cont: ; preds = %catch.3 | 72 try.cont: ; preds = %catch.3 |
73 catchret %0 to label %try.cont.5 | 73 catchret from %0 to label %try.cont.5 |
74 | 74 |
75 try.cont.5: ; preds = %try.cont | 75 try.cont.5: ; preds = %try.cont |
76 ret i32 0 | 76 ret i32 0 |
77 | 77 |
78 catchendblock.2: ; preds = %catch.dispatch.1 | |
79 catchendpad unwind label %catchendblock | |
80 | |
81 catchendblock: ; preds = %catchendblock.2, %catch.dispatch | |
82 catchendpad unwind to caller | |
83 | |
84 unreachable: ; preds = %catch, %entry | 78 unreachable: ; preds = %catch, %entry |
85 unreachable | 79 unreachable |
86 | |
87 } | 80 } |
88 | 81 |
89 ; CHECK-LABEL: test2: | 82 ; CHECK-LABEL: test2: |
90 | 83 |
91 ; The entry funclet contains %entry and %try.cont.5 | 84 ; The parent function contains %entry and %try.cont.5 |
85 ; CHECK: .seh_proc | |
92 ; CHECK: # %entry | 86 ; CHECK: # %entry |
93 ; CHECK: # %try.cont.5 | 87 ; CHECK: # %try.cont.5 |
94 ; CHECK: retq | 88 ; CHECK: retq |
95 | 89 |
96 ; The outer catch funclet contains %catch.dispatch | 90 ; The inner catch funclet contains %catch.3 |
97 ; CHECK: # %catch.dispatch{{$}} | 91 ; CHECK: .seh_proc |
92 ; CHECK: # %catch.3{{$}} | |
93 ; CHECK: retq | |
94 | |
95 ; The outer catch funclet contains %catch | |
96 ; CHECK: .seh_proc | |
97 ; CHECK: # %catch{{$}} | |
98 ; CHECK: callq _CxxThrowException | 98 ; CHECK: callq _CxxThrowException |
99 ; CHECK: # %unreachable | 99 ; CHECK: # %unreachable |
100 ; CHECK: ud2 | 100 ; CHECK: ud2 |
101 | |
102 ; The inner catch funclet contains %catch.dispatch.1 | |
103 ; CHECK: # %catch.dispatch.1 | |
104 ; CHECK: retq | |
105 | 101 |
106 | 102 |
107 define void @test3(i1 %V) #0 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) { | 103 define void @test3(i1 %V) #0 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) { |
108 entry: | 104 entry: |
109 invoke void @g() | 105 invoke void @g() |
110 to label %try.cont unwind label %catch.dispatch | 106 to label %try.cont unwind label %catch.dispatch |
111 | 107 |
112 catch.dispatch: ; preds = %entry | 108 catch.dispatch: ; preds = %entry |
113 %0 = catchpad [%rtti.TypeDescriptor2* @"\01??_R0H@8", i32 0, i8* null] | 109 %cs1 = catchswitch within none [label %catch.2] unwind label %catch.dispatch.1 |
114 to label %catch.2 unwind label %catch.dispatch.1 | |
115 | 110 |
116 catch.2: ; preds = %catch.dispatch | 111 catch.2: ; preds = %catch.dispatch |
117 tail call void @exit(i32 0) #2 | 112 %0 = catchpad within %cs1 [%rtti.TypeDescriptor2* @"\01??_R0H@8", i32 0, i8* null] |
113 tail call void @exit(i32 0) #2 [ "funclet"(token %0) ] | |
118 unreachable | 114 unreachable |
119 | 115 |
120 catch.dispatch.1: ; preds = %catch.dispatch | 116 catch.dispatch.1: ; preds = %catch.dispatch |
121 %1 = catchpad [i8* null, i32 64, i8* null] | 117 %cs2 = catchswitch within none [label %catch] unwind to caller |
122 to label %catch unwind label %catchendblock | |
123 | 118 |
124 catch: ; preds = %catch.dispatch.1 | 119 catch: ; preds = %catch.dispatch.1 |
125 tail call void @exit(i32 0) #2 | 120 %1 = catchpad within %cs2 [i8* null, i32 64, i8* null] |
121 tail call void @exit(i32 0) #2 [ "funclet"(token %1) ] | |
126 unreachable | 122 unreachable |
127 | |
128 catchendblock: ; preds = %catch.dispatch.1 | |
129 catchendpad unwind to caller | |
130 | 123 |
131 try.cont: ; preds = %entry | 124 try.cont: ; preds = %entry |
132 br i1 %V, label %exit_one, label %exit_two | 125 br i1 %V, label %exit_one, label %exit_two |
133 | 126 |
134 exit_one: | 127 exit_one: |
148 ; CHECK: callq exit | 141 ; CHECK: callq exit |
149 ; CHECK-NOT: # exit_one | 142 ; CHECK-NOT: # exit_one |
150 ; CHECK-NOT: # exit_two | 143 ; CHECK-NOT: # exit_two |
151 ; CHECK: ud2 | 144 ; CHECK: ud2 |
152 | 145 |
153 ; The catch(...) funclet contains %catch.dispatch | 146 ; The catch(...) funclet contains %catch.2 |
154 ; CHECK: # %catch.dispatch{{$}} | 147 ; CHECK: # %catch.2{{$}} |
155 ; CHECK: callq exit | 148 ; CHECK: callq exit |
156 ; CHECK: ud2 | 149 ; CHECK: ud2 |
157 | 150 |
158 ; The catch(int) funclet contains %catch.dispatch.1 | 151 ; The catch(int) funclet contains %catch |
159 ; CHECK: # %catch.dispatch.1 | 152 ; CHECK: # %catch{{$}} |
160 ; CHECK: callq exit | 153 ; CHECK: callq exit |
161 ; CHECK: ud2 | 154 ; CHECK: ud2 |
162 | 155 |
163 declare void @exit(i32) noreturn nounwind | 156 declare void @exit(i32) noreturn nounwind |
164 declare void @_CxxThrowException(i8*, %eh.ThrowInfo*) | 157 declare void @_CxxThrowException(i8*, %eh.ThrowInfo*) |