blob: 4e8a8d8868bdaf3779dd1049dd7b0ab6786ac4cd [file] [log] [blame]
David Majnemer1ef65402016-03-03 00:01:25 +00001; RUN: llc < %s | FileCheck %s
2target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
3target triple = "x86_64-pc-windows-msvc"
4
5declare void @rt_init()
6
7declare i32 @__CxxFrameHandler3(...)
8
9define void @test1(void ()* %fp, i64 %n) personality i32 (...)* @__CxxFrameHandler3 {
10entry:
11 %t.i = alloca i8*
12 %t.ii = alloca i8
13 %.alloca8 = alloca i8, i64 %n
14 store volatile i8 0, i8* %t.ii
15 store volatile i8 0, i8* %.alloca8
16 invoke void @rt_init()
17 to label %try.cont unwind label %catch.switch
18
19try.cont:
20 invoke void %fp()
21 to label %exit unwind label %catch.switch
22
23exit:
24 ret void
25
26catch.pad:
27 %cp = catchpad within %cs [i8* null, i32 0, i8** %t.i]
28 catchret from %cp to label %exit
29
30catch.switch:
31 %cs = catchswitch within none [label %catch.pad] unwind to caller
32}
33
34; CHECK-LABEL: $handlerMap$0$test1:
35; CHECK: .long 0
36; CHECK-NEXT: .long 0
37; CHECK-NEXT: .long 16
38
39define void @test2(void ()* %fp, i64 %n) personality i32 (...)* @__CxxFrameHandler3 {
40entry:
41 %t.i = alloca i128
42 %.alloca8 = alloca i8, i64 %n
43 store volatile i8 0, i8* %.alloca8
44 invoke void @rt_init()
45 to label %try.cont unwind label %catch.switch
46
47try.cont:
48 invoke void %fp()
49 to label %exit unwind label %catch.switch
50
51exit:
52 ret void
53
54catch.pad:
55 %cp = catchpad within %cs [i8* null, i32 0, i128* %t.i]
56 catchret from %cp to label %exit
57
58catch.switch:
59 %cs = catchswitch within none [label %catch.pad] unwind to caller
60}
61
62; CHECK-LABEL: $handlerMap$0$test2:
63; CHECK: .long 0
64; CHECK-NEXT: .long 0
65; CHECK-NEXT: .long 8