1 ; RUN: llc -mtriple x86_64-pc-linux-gnu < %s | FileCheck %s
3 ; This test demonstrates that it is possible to use functions for typeinfo
4 ; instead of global variables. While __gxx_personality_v0 would never know what
5 ; to do with them, other EH schemes such as SEH might use them.
7 declare i32 @__gxx_personality_v0(...)
11 declare i32 @llvm.eh.typeid.for(i8*)
13 define i32 @main() uwtable personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
16 to label %try.cont unwind label %lpad
22 %0 = landingpad { i8*, i32 }
24 catch i8* bitcast (void ()* @filt0 to i8*)
25 catch i8* bitcast (void ()* @filt1 to i8*)
26 %sel = extractvalue { i8*, i32 } %0, 1
27 %id0 = call i32 @llvm.eh.typeid.for(i8* bitcast (void ()* @filt0 to i8*))
28 %is_f0 = icmp eq i32 %sel, %id0
29 br i1 %is_f0, label %try.cont, label %check_f1
32 %id1 = call i32 @llvm.eh.typeid.for(i8* bitcast (void ()* @filt1 to i8*))
33 %is_f1 = icmp eq i32 %sel, %id1
34 br i1 %is_f1, label %try.cont, label %eh.resume
37 resume { i8*, i32 } %0
41 ; CHECK: .cfi_startproc
42 ; CHECK: .cfi_personality 3, __gxx_personality_v0
43 ; CHECK: .cfi_lsda 3, .Lexception0
44 ; CHECK: .cfi_def_cfa_offset 16
47 ; CHECK: cmpl $2, %edx
49 ; CHECK: cmpl $1, %edx
51 ; CHECK: callq _Unwind_Resume
53 ; CHECK: GCC_except_table0: