Mercurial > hg > CbC > CbC_llvm
comparison test/CodeGen/X86/win32-seh-catchpad-realign.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 < %s | FileCheck %s | |
2 | |
3 ; The aligned alloca means that we have to realign the stack, which forces the | |
4 ; use of ESI to address local variables. | |
5 | |
6 target datalayout = "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32" | |
7 target triple = "i686--windows-msvc" | |
8 | |
9 ; Function Attrs: nounwind | |
10 define void @realigned_try() personality i8* bitcast (i32 (...)* @_except_handler3 to i8*) { | |
11 entry: | |
12 %x = alloca [4 x i32], align 16 | |
13 %arrayidx = getelementptr inbounds [4 x i32], [4 x i32]* %x, i32 0, i32 0 | |
14 invoke void @useit(i32* %arrayidx) | |
15 to label %__try.cont unwind label %catch.dispatch | |
16 | |
17 catch.dispatch: ; preds = %entry | |
18 %pad = catchpad [i8* bitcast (i32 ()* @"\01?filt$0@0@realigned_try@@" to i8*)] | |
19 to label %__except.ret unwind label %catchendblock | |
20 | |
21 __except.ret: ; preds = %catch.dispatch | |
22 catchret %pad to label %__try.cont | |
23 | |
24 __try.cont: ; preds = %entry, %__except.ret | |
25 ret void | |
26 | |
27 catchendblock: ; preds = %catch.dispatch | |
28 catchendpad unwind to caller | |
29 } | |
30 | |
31 ; Function Attrs: nounwind argmemonly | |
32 | |
33 ; Function Attrs: nounwind | |
34 define internal i32 @"\01?filt$0@0@realigned_try@@"() { | |
35 entry: | |
36 ret i32 1 | |
37 } | |
38 | |
39 declare void @useit(i32*) | |
40 | |
41 declare i32 @_except_handler3(...) | |
42 | |
43 ; CHECK-LABEL: _realigned_try: | |
44 ; Prologue | |
45 ; CHECK: pushl %ebp | |
46 ; CHECK: movl %esp, %ebp | |
47 ; CHECK: pushl %ebx | |
48 ; CHECK: pushl %edi | |
49 ; CHECK: pushl %esi | |
50 ; CHECK: andl $-16, %esp | |
51 ; CHECK: subl $64, %esp | |
52 ; CHECK: movl %esp, %esi | |
53 ; Spill EBP | |
54 ; CHECK: movl %ebp, 12(%esi) | |
55 ; Spill ESP | |
56 ; CHECK: movl %esp, 36(%esi) | |
57 ; The state is stored at ESI+56, the end of the node is ESI+60. | |
58 ; CHECK: movl $-1, 56(%esi) | |
59 ; | |
60 ; __try | |
61 ; CHECK: calll _useit | |
62 ; | |
63 ; Epilogue | |
64 ; CHECK: LBB0_1: # %__try.cont | |
65 ; CHECK: leal -12(%ebp), %esp | |
66 ; CHECK: popl %esi | |
67 ; CHECK: popl %edi | |
68 ; CHECK: popl %ebx | |
69 ; CHECK: popl %ebp | |
70 ; CHECK: retl | |
71 ; | |
72 ; CHECK: LBB0_2: # %catch.dispatch | |
73 ; Restore ESP | |
74 ; CHECK: movl -24(%ebp), %esp | |
75 ; Recompute ESI by subtracting 60 from the end of the registration node. | |
76 ; CHECK: leal -60(%ebp), %esi | |
77 ; Restore EBP | |
78 ; CHECK: movl 12(%esi), %ebp | |
79 ; Rejoin normal control flow | |
80 ; CHECK: jmp LBB0_1 |