David Majnemer | 1ef6540 | 2016-03-03 00:01:25 +0000 | [diff] [blame] | 1 | ; RUN: llc < %s | FileCheck %s |
| 2 | target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128" |
| 3 | target triple = "x86_64-pc-windows-msvc" |
| 4 | |
| 5 | declare void @rt_init() |
| 6 | |
| 7 | declare i32 @__CxxFrameHandler3(...) |
| 8 | |
| 9 | define void @test1(void ()* %fp, i64 %n) personality i32 (...)* @__CxxFrameHandler3 { |
| 10 | entry: |
| 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 | |
| 19 | try.cont: |
| 20 | invoke void %fp() |
| 21 | to label %exit unwind label %catch.switch |
| 22 | |
| 23 | exit: |
| 24 | ret void |
| 25 | |
| 26 | catch.pad: |
| 27 | %cp = catchpad within %cs [i8* null, i32 0, i8** %t.i] |
| 28 | catchret from %cp to label %exit |
| 29 | |
| 30 | catch.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 | |
| 39 | define void @test2(void ()* %fp, i64 %n) personality i32 (...)* @__CxxFrameHandler3 { |
| 40 | entry: |
| 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 | |
| 47 | try.cont: |
| 48 | invoke void %fp() |
| 49 | to label %exit unwind label %catch.switch |
| 50 | |
| 51 | exit: |
| 52 | ret void |
| 53 | |
| 54 | catch.pad: |
| 55 | %cp = catchpad within %cs [i8* null, i32 0, i128* %t.i] |
| 56 | catchret from %cp to label %exit |
| 57 | |
| 58 | catch.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 |