1 ; RUN: opt < %s -basicaa -gvn -S | FileCheck %s
2 %struct.__fundamental_type_info_pseudo = type { %struct.__type_info_pseudo }
3 %struct.__type_info_pseudo = type { i8*, i8* }
5 @_ZTIi = external constant %struct.__fundamental_type_info_pseudo
6 @_ZTIb = external constant %struct.__fundamental_type_info_pseudo
8 declare void @_Z4barv()
10 declare void @_Z7cleanupv()
12 declare i32 @llvm.eh.typeid.for(i8*) nounwind readonly
14 declare i8* @__cxa_begin_catch(i8*) nounwind
16 declare void @__cxa_end_catch()
18 declare i32 @__gxx_personality_v0(i32, i64, i8*, i8*)
20 define void @_Z3foov() uwtable {
22 invoke void @_Z4barv()
23 to label %return unwind label %lpad
25 lpad: ; preds = %entry
26 %0 = landingpad { i8*, i32 } personality i32 (i32, i64, i8*, i8*)* @__gxx_personality_v0
27 catch %struct.__fundamental_type_info_pseudo* @_ZTIi
28 catch %struct.__fundamental_type_info_pseudo* @_ZTIb
29 catch %struct.__fundamental_type_info_pseudo* @_ZTIi
30 catch %struct.__fundamental_type_info_pseudo* @_ZTIb
31 %exc_ptr2.i = extractvalue { i8*, i32 } %0, 0
32 %filter3.i = extractvalue { i8*, i32 } %0, 1
33 %typeid.i = tail call i32 @llvm.eh.typeid.for(i8* bitcast (%struct.__fundamental_type_info_pseudo* @_ZTIi to i8*))
34 ; CHECK: call i32 @llvm.eh.typeid.for
35 %1 = icmp eq i32 %filter3.i, %typeid.i
36 br i1 %1, label %ppad, label %next
39 %typeid1.i = tail call i32 @llvm.eh.typeid.for(i8* bitcast (%struct.__fundamental_type_info_pseudo* @_ZTIb to i8*))
40 ; CHECK: call i32 @llvm.eh.typeid.for
41 %2 = icmp eq i32 %filter3.i, %typeid1.i
42 br i1 %2, label %ppad2, label %next2
45 %3 = tail call i8* @__cxa_begin_catch(i8* %exc_ptr2.i) nounwind
46 tail call void @__cxa_end_catch() nounwind
49 ppad2: ; preds = %next
50 %D.2073_5.i = tail call i8* @__cxa_begin_catch(i8* %exc_ptr2.i) nounwind
51 tail call void @__cxa_end_catch() nounwind
54 next2: ; preds = %next
55 call void @_Z7cleanupv()
56 %typeid = tail call i32 @llvm.eh.typeid.for(i8* bitcast (%struct.__fundamental_type_info_pseudo* @_ZTIi to i8*))
57 ; CHECK-NOT: call i32 @llvm.eh.typeid.for
58 %4 = icmp eq i32 %filter3.i, %typeid
59 br i1 %4, label %ppad3, label %next3
61 next3: ; preds = %next2
62 %typeid1 = tail call i32 @llvm.eh.typeid.for(i8* bitcast (%struct.__fundamental_type_info_pseudo* @_ZTIb to i8*))
63 %5 = icmp eq i32 %filter3.i, %typeid1
64 br i1 %5, label %ppad4, label %unwind
66 unwind: ; preds = %next3
67 resume { i8*, i32 } %0
69 ppad3: ; preds = %next2
70 %6 = tail call i8* @__cxa_begin_catch(i8* %exc_ptr2.i) nounwind
71 tail call void @__cxa_end_catch() nounwind
74 ppad4: ; preds = %next3
75 %D.2080_5 = tail call i8* @__cxa_begin_catch(i8* %exc_ptr2.i) nounwind
76 tail call void @__cxa_end_catch() nounwind
79 return: ; preds = %ppad4, %ppad3, %ppad2, %ppad, %entry