• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc  -mtriple=x86_64-unknown-unknown --exception-model=sjlj --print-after=sjljehprepare < %s 2>&1 | FileCheck --check-prefix=CHECK-X86 %s
2; RUN: (llc  -mtriple=ve-unknown-unknown --exception-model=sjlj  --print-after=sjljehprepare < %s || true) 2>&1 | FileCheck --check-prefix=CHECK-VE %s
3
4@SomeGlobal = external dso_local global i8
5
6define dso_local i32 @foo(i32 %arg) local_unnamed_addr personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) {
7; CHECK-VE: *** IR Dump After SJLJ Exception Handling preparation ***
8; CHECK-VE-NEXT: define dso_local i32 @foo(i32 %arg) local_unnamed_addr personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) {
9; CHECK-VE-NEXT: entry:
10; CHECK-VE-NEXT:   %fn_context = alloca { i8*, i64, [4 x i64], i8*, i8*, [5 x i8*] }, align 8
11; CHECK-VE-NEXT:   %arg.tmp = select i1 true, i32 %arg, i32 undef
12; CHECK-VE-NEXT:   %pers_fn_gep = getelementptr { i8*, i64, [4 x i64], i8*, i8*, [5 x i8*] }, { i8*, i64, [4 x i64], i8*, i8*, [5 x i8*] }* %fn_context, i32 0, i32 3
13; CHECK-X86: *** IR Dump After SJLJ Exception Handling preparation ***
14; CHECK-X86-NEXT: define dso_local i32 @foo(i32 %arg) local_unnamed_addr personality i8* bitcast (i32 (...)* @__gxx_personality_sj0 to i8*) {
15; CHECK-X86-NEXT: entry:
16; CHECK-X86-NEXT:   %fn_context = alloca { i8*, i32, [4 x i32], i8*, i8*, [5 x i8*] }, align 8
17; CHECK-X86-NEXT:   %arg.tmp = select i1 true, i32 %arg, i32 undef
18; CHECK-X86-NEXT:   %pers_fn_gep = getelementptr { i8*, i32, [4 x i32], i8*, i8*, [5 x i8*] }, { i8*, i32, [4 x i32], i8*, i8*, [5 x i8*] }* %fn_context, i32 0, i32 3
19entry:
20  invoke void @errorbar() to label %exit unwind label %handle
21
22handle:
23  %error = landingpad { i8*, i32 } catch i8* @SomeGlobal
24  ret i32 1
25
26exit:
27  ret i32 0
28}
29
30declare dso_local void @errorbar() local_unnamed_addr
31
32declare dso_local i32 @__gxx_personality_sj0(...)
33