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* } 4 5@_ZTIi = external constant %struct.__fundamental_type_info_pseudo 6@_ZTIb = external constant %struct.__fundamental_type_info_pseudo 7 8declare void @_Z4barv() 9 10declare void @_Z7cleanupv() 11 12declare i32 @llvm.eh.typeid.for(i8*) nounwind readonly 13 14declare i8* @__cxa_begin_catch(i8*) nounwind 15 16declare void @__cxa_end_catch() 17 18declare i32 @__gxx_personality_v0(i32, i64, i8*, i8*) 19 20define void @_Z3foov() uwtable { 21entry: 22 invoke void @_Z4barv() 23 to label %return unwind label %lpad 24 25lpad: ; 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 37 38next: ; preds = %lpad 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 43 44ppad: ; preds = %lpad 45 %3 = tail call i8* @__cxa_begin_catch(i8* %exc_ptr2.i) nounwind 46 tail call void @__cxa_end_catch() nounwind 47 br label %return 48 49ppad2: ; 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 52 br label %return 53 54next2: ; 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 60 61next3: ; 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 65 66unwind: ; preds = %next3 67 resume { i8*, i32 } %0 68 69ppad3: ; preds = %next2 70 %6 = tail call i8* @__cxa_begin_catch(i8* %exc_ptr2.i) nounwind 71 tail call void @__cxa_end_catch() nounwind 72 br label %return 73 74ppad4: ; 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 77 br label %return 78 79return: ; preds = %ppad4, %ppad3, %ppad2, %ppad, %entry 80 ret void 81} 82