Mercurial > hg > CbC > CbC_llvm
comparison test/CodeGen/X86/funclet-layout.ll @ 95:afa8332a0e37 LLVM3.8
LLVM 3.8
author | Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 13 Oct 2015 17:48:58 +0900 |
parents | |
children | 7d135dc70f03 |
comparison
equal
deleted
inserted
replaced
84:f3e34b893a5f | 95:afa8332a0e37 |
---|---|
1 ; RUN: llc -mtriple=x86_64-windows-msvc < %s | FileCheck %s | |
2 | |
3 target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128" | |
4 target triple = "x86_64-pc-windows-msvc" | |
5 | |
6 %eh.ThrowInfo = type { i32, i32, i32, i32 } | |
7 %rtti.TypeDescriptor2 = type { i8**, i8*, [3 x i8] } | |
8 | |
9 @"\01??_7type_info@@6B@" = external constant i8* | |
10 @"\01??_R0H@8" = internal global %rtti.TypeDescriptor2 { i8** @"\01??_7type_info@@6B@", i8* null, [3 x i8] c".H\00" } | |
11 | |
12 define void @test1(i1 %B) personality i32 (...)* @__CxxFrameHandler3 { | |
13 entry: | |
14 invoke void @g() | |
15 to label %unreachable unwind label %catch.dispatch | |
16 | |
17 catch.dispatch: | |
18 %cp = catchpad [i8* null, i32 64, i8* null] | |
19 to label %catch unwind label %catchendblock | |
20 | |
21 catch: | |
22 br i1 %B, label %catchret, label %catch | |
23 | |
24 catchret: | |
25 catchret %cp to label %try.cont | |
26 | |
27 try.cont: | |
28 ret void | |
29 | |
30 catchendblock: | |
31 catchendpad unwind to caller | |
32 | |
33 unreachable: | |
34 unreachable | |
35 } | |
36 | |
37 ; CHECK-LABEL: test1: | |
38 | |
39 ; The entry funclet contains %entry and %try.cont | |
40 ; CHECK: # %entry | |
41 ; CHECK: # %try.cont | |
42 ; CHECK: retq | |
43 | |
44 ; The catch funclet contains %catch and %catchret | |
45 ; CHECK: # %catch{{$}} | |
46 ; CHECK: # %catchret | |
47 ; CHECK: retq | |
48 | |
49 declare void @g() | |
50 | |
51 | |
52 define i32 @test2(i1 %B) personality i32 (...)* @__CxxFrameHandler3 { | |
53 entry: | |
54 invoke void @_CxxThrowException(i8* null, %eh.ThrowInfo* null) #1 | |
55 to label %unreachable unwind label %catch.dispatch | |
56 | |
57 catch.dispatch: ; preds = %entry | |
58 %0 = catchpad [i8* null, i32 64, i8* null] | |
59 to label %catch unwind label %catchendblock | |
60 | |
61 catch: ; preds = %catch.dispatch | |
62 invoke void @_CxxThrowException(i8* null, %eh.ThrowInfo* null) #1 | |
63 to label %unreachable unwind label %catch.dispatch.1 | |
64 | |
65 catch.dispatch.1: ; preds = %catch | |
66 %1 = catchpad [i8* null, i32 64, i8* null] | |
67 to label %catch.3 unwind label %catchendblock.2 | |
68 | |
69 catch.3: ; preds = %catch.dispatch.1 | |
70 catchret %1 to label %try.cont | |
71 | |
72 try.cont: ; preds = %catch.3 | |
73 catchret %0 to label %try.cont.5 | |
74 | |
75 try.cont.5: ; preds = %try.cont | |
76 ret i32 0 | |
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 | |
85 unreachable | |
86 | |
87 } | |
88 | |
89 ; CHECK-LABEL: test2: | |
90 | |
91 ; The entry funclet contains %entry and %try.cont.5 | |
92 ; CHECK: # %entry | |
93 ; CHECK: # %try.cont.5 | |
94 ; CHECK: retq | |
95 | |
96 ; The outer catch funclet contains %catch.dispatch | |
97 ; CHECK: # %catch.dispatch{{$}} | |
98 ; CHECK: callq _CxxThrowException | |
99 ; CHECK: # %unreachable | |
100 ; CHECK: ud2 | |
101 | |
102 ; The inner catch funclet contains %catch.dispatch.1 | |
103 ; CHECK: # %catch.dispatch.1 | |
104 ; CHECK: retq | |
105 | |
106 | |
107 define void @test3(i1 %V) #0 personality i8* bitcast (i32 (...)* @__CxxFrameHandler3 to i8*) { | |
108 entry: | |
109 invoke void @g() | |
110 to label %try.cont unwind label %catch.dispatch | |
111 | |
112 catch.dispatch: ; preds = %entry | |
113 %0 = catchpad [%rtti.TypeDescriptor2* @"\01??_R0H@8", i32 0, i8* null] | |
114 to label %catch.2 unwind label %catch.dispatch.1 | |
115 | |
116 catch.2: ; preds = %catch.dispatch | |
117 tail call void @exit(i32 0) #2 | |
118 unreachable | |
119 | |
120 catch.dispatch.1: ; preds = %catch.dispatch | |
121 %1 = catchpad [i8* null, i32 64, i8* null] | |
122 to label %catch unwind label %catchendblock | |
123 | |
124 catch: ; preds = %catch.dispatch.1 | |
125 tail call void @exit(i32 0) #2 | |
126 unreachable | |
127 | |
128 catchendblock: ; preds = %catch.dispatch.1 | |
129 catchendpad unwind to caller | |
130 | |
131 try.cont: ; preds = %entry | |
132 br i1 %V, label %exit_one, label %exit_two | |
133 | |
134 exit_one: | |
135 tail call void @exit(i32 0) | |
136 unreachable | |
137 | |
138 exit_two: | |
139 tail call void @exit(i32 0) | |
140 unreachable | |
141 } | |
142 | |
143 ; CHECK-LABEL: test3: | |
144 | |
145 ; The entry funclet contains %entry and %try.cont | |
146 ; CHECK: # %entry | |
147 ; CHECK: # %try.cont | |
148 ; CHECK: callq exit | |
149 ; CHECK-NOT: # exit_one | |
150 ; CHECK-NOT: # exit_two | |
151 ; CHECK: ud2 | |
152 | |
153 ; The catch(...) funclet contains %catch.dispatch | |
154 ; CHECK: # %catch.dispatch{{$}} | |
155 ; CHECK: callq exit | |
156 ; CHECK: ud2 | |
157 | |
158 ; The catch(int) funclet contains %catch.dispatch.1 | |
159 ; CHECK: # %catch.dispatch.1 | |
160 ; CHECK: callq exit | |
161 ; CHECK: ud2 | |
162 | |
163 declare void @exit(i32) noreturn nounwind | |
164 declare void @_CxxThrowException(i8*, %eh.ThrowInfo*) | |
165 declare i32 @__CxxFrameHandler3(...) |