Skip to content

Commit c7feb6b

Browse files
committed
[WinEH] Re-run stack coloring test for i686
This would've caught https://crbug.com/1045650, which resulted in the revert of 7a8b0b1.
1 parent 34ab569 commit c7feb6b

File tree

1 file changed

+57
-22
lines changed

1 file changed

+57
-22
lines changed

llvm/test/CodeGen/X86/catchpad-lifetime.ll

Lines changed: 57 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
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
53

64
declare void @throw()
75

@@ -17,15 +15,27 @@ entry:
1715
invoke void @throw()
1816
to label %unreachable unwind label %catch.dispatch
1917

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
2332

2433
catch.dispatch: ; preds = %entry
2534
%cs = catchswitch within none [label %catch.pad] unwind to caller
2635

2736
catch.pad: ; preds = %catch.dispatch
2837
%cp = catchpad within %cs [i8* null, i32 0, i8** %alloca1]
38+
%v = load volatile i8*, i8** %alloca1
2939
store volatile i8* null, i8** %alloca1
3040
%bc1 = bitcast i8** %alloca1 to i8*
3141
call void @llvm.lifetime.end.p0i8(i64 4, i8* nonnull %bc1)
@@ -35,17 +45,27 @@ catch.pad: ; preds = %catch.dispatch
3545
call void @llvm.trap()
3646
unreachable
3747

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
4257

4358
unreachable: ; preds = %entry
4459
unreachable
4560
}
4661

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
4969

5070
define void @test2() personality i32 (...)* @__CxxFrameHandler3 {
5171
entry:
@@ -55,9 +75,14 @@ entry:
5575
invoke void @throw()
5676
to label %unreachable unwind label %catch.dispatch
5777

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+
6186

6287
catch.dispatch: ; preds = %entry
6388
%cs = catchswitch within none [label %catch.pad] unwind to caller
@@ -73,17 +98,27 @@ catch.pad: ; preds = %catch.dispatch
7398
call void @llvm.trap()
7499
unreachable
75100

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+
80111

81112
unreachable: ; preds = %entry
82113
unreachable
83114
}
84115

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
87122

88123

89124
; Function Attrs: argmemonly nounwind

0 commit comments

Comments
 (0)