1 ; RUN: llc < %s -mtriple=aarch64-pc-mingw32 | FileCheck %s -check-prefix=WINEH
2 ; RUN: llc < %s -mtriple=aarch64-pc-mingw32 -filetype=obj | llvm-readobj -S | FileCheck %s -check-prefix=WINEH-SECTIONS
4 ; Check emission of eh handler and handler data
5 declare i32 @_d_eh_personality(i32, i32, i64, i8*, i8*)
6 declare void @_d_eh_resume_unwind(i8*)
10 define i32 @foo4() #0 personality i32 (i32, i32, i64, i8*, i8*)* @_d_eh_personality {
12 %step = alloca i32, align 4
13 store i32 0, i32* %step
14 %tmp = load i32, i32* %step
16 %tmp1 = invoke i32 @bar()
17 to label %finally unwind label %landingpad
20 store i32 1, i32* %step
21 br label %endtryfinally
24 %landing_pad = landingpad { i8*, i32 }
26 %tmp3 = extractvalue { i8*, i32 } %landing_pad, 0
27 store i32 2, i32* %step
28 call void @_d_eh_resume_unwind(i8* %tmp3)
32 %tmp10 = load i32, i32* %step
36 ; WINEH: .seh_proc foo4
37 ; WINEH: .seh_handler _d_eh_personality, @unwind, @except
39 ; WINEH: .section .xdata,"dr"
40 ; WINEH-NEXT: .seh_handlerdata
42 ; WINEH-NEXT: .seh_endproc
43 ; WINEH: .section .xdata,"dr"
44 ; WINEH-NEXT: .p2align 2
45 ; WINEH-NEXT: GCC_except_table0:
47 ; WINEH-SECTIONS: Name: .xdata
48 ; WINEH-SECTIONS-NOT: Name: .gcc_except_table