1 ; RUN: llc -mtriple=x86_64-pc-linux-gnu -code-model=kernel -simplifycfg-require-and-preserve-domtree=1 %s -o - | FileCheck %s
3 ; CHECK: .cfi_startproc
4 ; CHECK: .cfi_personality 0, __gxx_personality_v0
5 ; CHECK: .cfi_lsda 0, [[EXCEPTION_LABEL:.L[^ ]*]]
6 ; CHECK: [[EXCEPTION_LABEL]]:
7 ; CHECK: .byte 0 # @TType Encoding = absptr
10 @_ZTIi = external constant i8*
12 ; Function Attrs: noinline norecurse optnone uwtable
13 define i32 @main() #0 personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
14 %1 = alloca i32, align 4
17 %4 = alloca i32, align 4
18 store i32 0, i32* %1, align 4
19 %5 = call i8* @__cxa_allocate_exception(i64 4) #2
20 %6 = bitcast i8* %5 to i32*
21 store i32 20, i32* %6, align 16
22 invoke void @__cxa_throw(i8* %5, i8* bitcast (i8** @_ZTIi to i8*), i8* null) #3
23 to label %26 unwind label %7
25 ; <label>:7: ; preds = %0
26 %8 = landingpad { i8*, i32 }
27 catch i8* bitcast (i8** @_ZTIi to i8*)
28 %9 = extractvalue { i8*, i32 } %8, 0
29 store i8* %9, i8** %2, align 8
30 %10 = extractvalue { i8*, i32 } %8, 1
31 store i32 %10, i32* %3, align 4
34 ; <label>:11: ; preds = %7
35 %12 = load i32, i32* %3, align 4
36 %13 = call i32 @llvm.eh.typeid.for(i8* bitcast (i8** @_ZTIi to i8*)) #2
37 %14 = icmp eq i32 %12, %13
38 br i1 %14, label %15, label %21
40 ; <label>:15: ; preds = %11
41 %16 = load i8*, i8** %2, align 8
42 %17 = call i8* @__cxa_begin_catch(i8* %16) #2
43 %18 = bitcast i8* %17 to i32*
44 %19 = load i32, i32* %18, align 4
45 store i32 %19, i32* %4, align 4
46 call void @__cxa_end_catch() #2
49 ; <label>:20: ; preds = %15
52 ; <label>:21: ; preds = %11
53 %22 = load i8*, i8** %2, align 8
54 %23 = load i32, i32* %3, align 4
55 %24 = insertvalue { i8*, i32 } undef, i8* %22, 0
56 %25 = insertvalue { i8*, i32 } %24, i32 %23, 1
57 resume { i8*, i32 } %25
59 ; <label>:26: ; preds = %0
63 declare i8* @__cxa_allocate_exception(i64)
65 declare void @__cxa_throw(i8*, i8*, i8*)
67 declare i32 @__gxx_personality_v0(...)
69 ; Function Attrs: nounwind readnone
70 declare i32 @llvm.eh.typeid.for(i8*) #1
72 declare i8* @__cxa_begin_catch(i8*)
74 declare void @__cxa_end_catch()
76 attributes #0 = { noinline norecurse optnone uwtable }
77 attributes #1 = { nounwind readnone }
78 attributes #2 = { nounwind }
79 attributes #3 = { noreturn }