1 ; RUN: opt < %s -passes=inline,argpromotion,instcombine -disable-output
3 ; This test was failing because the inliner would inline @list_DeleteElement
4 ; into @list_DeleteDuplicates and then into @inf_GetBackwardPartnerLits,
5 ; turning the indirect call into a direct one. This allowed instcombine to see
6 ; the bitcast and eliminate it, deleting the original call and introducing
7 ; another one. This crashed the inliner because the new call was not in the
10 target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
11 target triple = "i386-apple-darwin10.0"
14 define void @list_DeleteElement(ptr nocapture %Test) nounwind ssp {
16 %0 = call i32 %Test(ptr null, ptr undef) nounwind
21 define void @list_DeleteDuplicates(ptr nocapture %Test) nounwind ssp {
23 call void @list_DeleteElement(ptr %Test) nounwind ssp
24 call fastcc void @list_Rplacd1284() nounwind ssp
29 define internal i32 @inf_LiteralsHaveSameSubtermAndAreFromSameClause(ptr nocapture %L1, ptr nocapture %L2) nounwind readonly ssp {
35 define internal fastcc void @inf_GetBackwardPartnerLits(ptr nocapture %Flags) nounwind ssp {
37 call void @list_DeleteDuplicates(ptr @inf_LiteralsHaveSameSubtermAndAreFromSameClause) nounwind
42 define void @inf_BackwardEmptySortPlusPlus() nounwind ssp {
44 call fastcc void @inf_GetBackwardPartnerLits(ptr null) nounwind ssp
48 define void @inf_BackwardWeakening() nounwind ssp {
50 call fastcc void @inf_GetBackwardPartnerLits(ptr null) nounwind ssp
54 declare fastcc void @list_Rplacd1284() nounwind ssp
59 ;============================
62 define void @AAA() personality ptr @__gxx_personality_v0 {
64 %A = alloca i8, i32 undef, align 1
65 invoke fastcc void @XXX()
66 to label %invcont98 unwind label %lpad156
72 %exn = landingpad {ptr, i32}
77 declare i32 @__gxx_personality_v0(...)
79 declare fastcc void @YYY()
81 define internal fastcc void @XXX() personality ptr @__gxx_personality_v0 {
83 %B = alloca i8, i32 undef, align 1
84 invoke fastcc void @YYY()
85 to label %bb260 unwind label %lpad
91 %exn = landingpad {ptr, i32}
93 resume { ptr, i32 } %exn
98 ;; This exposed a crash handling devirtualized calls.
99 define void @f1(ptr %f) ssp {
105 define void @f4(i32 %size) ssp personality ptr @__gxx_personality_v0 {
107 invoke void @f1(ptr @f3)
108 to label %invcont3 unwind label %lpad18
110 invcont3: ; preds = %bb1
113 lpad18: ; preds = %invcont3, %bb1
114 %exn = landingpad {ptr, i32}
119 define void @f3() ssp {
124 declare void @f5() ssp