1
- ; RUN: llc < %s | FileCheck %s
2
-
3
- target datalayout = "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32"
4
- target triple = "x86_64-pc-windows-msvc"
1
+ ; RUN: llc -mtriple=x86_64-windows-msvc < %s | FileCheck %s --check-prefix=X64
2
+ ; RUN: llc -mtriple=i686-windows-msvc < %s | FileCheck %s --check-prefix=X86
5
3
6
4
declare void @throw ()
7
5
@@ -17,15 +15,27 @@ entry:
17
15
invoke void @throw ()
18
16
to label %unreachable unwind label %catch.dispatch
19
17
20
- ; CHECK-LABEL: test1:
21
- ; CHECK: movq $0, -8(%rbp)
22
- ; CHECK: callq throw
18
+ ; X64-LABEL: test1:
19
+ ; X64: movq $0, -8(%rbp)
20
+ ; X64: callq throw
21
+
22
+ ; X86-LABEL: _test1:
23
+ ; X86: pushl %ebp
24
+ ; X86: movl %esp, %ebp
25
+ ; X86: pushl %ebx
26
+ ; X86: pushl %edi
27
+ ; X86: pushl %esi
28
+ ; X86: subl $24, %esp
29
+
30
+ ; X86: movl $0, -32(%ebp)
31
+ ; X86: calll _throw
23
32
24
33
catch.dispatch: ; preds = %entry
25
34
%cs = catchswitch within none [label %catch.pad ] unwind to caller
26
35
27
36
catch.pad: ; preds = %catch.dispatch
28
37
%cp = catchpad within %cs [i8* null , i32 0 , i8** %alloca1 ]
38
+ %v = load volatile i8* , i8** %alloca1
29
39
store volatile i8* null , i8** %alloca1
30
40
%bc1 = bitcast i8** %alloca1 to i8*
31
41
call void @llvm.lifetime.end.p0i8 (i64 4 , i8* nonnull %bc1 )
@@ -35,17 +45,27 @@ catch.pad: ; preds = %catch.dispatch
35
45
call void @llvm.trap ()
36
46
unreachable
37
47
38
- ; CHECK-LABEL: "?catch$2@?0?test1@4HA"
39
- ; CHECK: movq $0, -8(%rbp)
40
- ; CHECK: movq $0, -8(%rbp)
41
- ; CHECK: ud2
48
+ ; X64-LABEL: "?catch$2@?0?test1@4HA"
49
+ ; X64: movq $0, -8(%rbp)
50
+ ; X64: movq $0, -8(%rbp)
51
+ ; X64: ud2
52
+
53
+ ; X86-LABEL: "?catch$2@?0?test1@4HA"
54
+ ; X86: movl $0, -32(%ebp)
55
+ ; X86: movl $0, -32(%ebp)
56
+ ; X86: ud2
42
57
43
58
unreachable: ; preds = %entry
44
59
unreachable
45
60
}
46
61
47
- ; CHECK-LABEL: $cppxdata$test1:
48
- ; CHECK: .long 56 # CatchObjOffset
62
+ ; X64-LABEL: $cppxdata$test1:
63
+ ; X64: .long 56 # CatchObjOffset
64
+
65
+ ; -20 is difference between the end of the EH reg node stack object and the
66
+ ; catch object at EBP -32.
67
+ ; X86-LABEL: L__ehtable$test1:
68
+ ; X86: .long -20 # CatchObjOffset
49
69
50
70
define void @test2 () personality i32 (...)* @__CxxFrameHandler3 {
51
71
entry:
@@ -55,9 +75,14 @@ entry:
55
75
invoke void @throw ()
56
76
to label %unreachable unwind label %catch.dispatch
57
77
58
- ; CHECK-LABEL: test2:
59
- ; CHECK: movq $0, -16(%rbp)
60
- ; CHECK: callq throw
78
+ ; X64-LABEL: test2:
79
+ ; X64: movq $0, -16(%rbp)
80
+ ; X64: callq throw
81
+
82
+ ; X86-LABEL: _test2:
83
+ ; X86: movl $0, -32(%ebp)
84
+ ; X86: calll _throw
85
+
61
86
62
87
catch.dispatch: ; preds = %entry
63
88
%cs = catchswitch within none [label %catch.pad ] unwind to caller
@@ -73,17 +98,27 @@ catch.pad: ; preds = %catch.dispatch
73
98
call void @llvm.trap ()
74
99
unreachable
75
100
76
- ; CHECK-LABEL: "?catch$2@?0?test2@4HA"
77
- ; CHECK: movq $0, -16(%rbp)
78
- ; CHECK: movq $0, -16(%rbp)
79
- ; CHECK: ud2
101
+ ; X64-LABEL: "?catch$2@?0?test2@4HA"
102
+ ; X64: movq $0, -16(%rbp)
103
+ ; X64: movq $0, -16(%rbp)
104
+ ; X64: ud2
105
+
106
+ ; X86-LABEL: "?catch$2@?0?test2@4HA"
107
+ ; X86: movl $0, -32(%ebp)
108
+ ; X86: movl $0, -32(%ebp)
109
+ ; X86: ud2
110
+
80
111
81
112
unreachable: ; preds = %entry
82
113
unreachable
83
114
}
84
115
85
- ; CHECK-LABEL: $cppxdata$test2:
86
- ; CHECK: .long 0 # CatchObjOffset
116
+ ; X64-LABEL: $cppxdata$test2:
117
+ ; X64: .long 0 # CatchObjOffset
118
+
119
+
120
+ ; X86-LABEL: L__ehtable$test2:
121
+ ; X86: .long 0 # CatchObjOffset
87
122
88
123
89
124
; Function Attrs: argmemonly nounwind
0 commit comments