931046e51158150ed130fd37636acb75630d2f19
[oota-llvm.git] / test / CodeGen / X86 / seh-catch-all.ll
1 ; RUN: llc -mtriple=x86_64-windows-msvc < %s | FileCheck %s
2
3 @str = internal unnamed_addr constant [10 x i8] c"recovered\00", align 1
4
5 declare i32 @__C_specific_handler(...)
6 declare void @crash()
7 declare i32 @puts(i8*)
8
9 define i32 @main() {
10 entry:
11   invoke void @crash()
12           to label %__try.cont unwind label %lpad
13
14 lpad:
15   %0 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*)
16           catch i8* null
17   call i32 @puts(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
18   br label %__try.cont
19
20 __try.cont:
21   ret i32 0
22
23 eh.resume:
24   resume { i8*, i32 } %0
25 }
26
27 ; CHECK-LABEL: main:
28 ; CHECK: .seh_handlerdata
29 ; CHECK-NEXT: .long 1
30 ; CHECK-NEXT: .Ltmp{{[0-9]+}}@IMGREL
31 ; CHECK-NEXT: .Ltmp{{[0-9]+}}@IMGREL+1
32 ; CHECK-NEXT: 1
33 ; CHECK-NEXT: .Ltmp{{[0-9]+}}@IMGREL