• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
3
4; Check emission of eh handler and handler data
5declare i32 @_d_eh_personality(i32, i32, i64, i8*, i8*)
6declare void @_d_eh_resume_unwind(i8*)
7
8declare i32 @bar()
9
10define i32 @foo4() #0 personality i32 (i32, i32, i64, i8*, i8*)* @_d_eh_personality {
11entry:
12  %step = alloca i32, align 4
13  store i32 0, i32* %step
14  %tmp = load i32, i32* %step
15
16  %tmp1 = invoke i32 @bar()
17          to label %finally unwind label %landingpad
18
19finally:
20  store i32 1, i32* %step
21  br label %endtryfinally
22
23landingpad:
24  %landing_pad = landingpad { i8*, i32 }
25          cleanup
26  %tmp3 = extractvalue { i8*, i32 } %landing_pad, 0
27  store i32 2, i32* %step
28  call void @_d_eh_resume_unwind(i8* %tmp3)
29  unreachable
30
31endtryfinally:
32  %tmp10 = load i32, i32* %step
33  ret i32 %tmp10
34}
35; WINEH-LABEL: foo4:
36; WINEH: .seh_proc foo4
37; WINEH: .seh_handler _d_eh_personality, @unwind, @except
38; WINEH: ret
39; WINEH:      .seh_handlerdata
40; WINEH-NEXT: .text
41; WINEH-NEXT: .seh_endproc
42; WINEH: .section .xdata,"dr"
43; WINEH-NEXT: .p2align 2
44; WINEH-NEXT: GCC_except_table0:
45
46; WINEH-SECTIONS: Name: .xdata
47; WINEH-SECTIONS-NOT: Name: .gcc_except_table
48