summaryrefslogtreecommitdiffstats
path: root/test/Transforms/Inline/crash.ll
blob: 30eae7a96a7b7d9b0fac45f61e0ad4f955847406 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
; RUN: opt < %s -inline -argpromotion -instcombine -disable-output

; This test was failing because the inliner would inline @list_DeleteElement
; into @list_DeleteDuplicates and then into @inf_GetBackwardPartnerLits,
; turning the indirect call into a direct one.  This allowed instcombine to see
; the bitcast and eliminate it, deleting the original call and introducing
; another one.  This crashed the inliner because the new call was not in the
; callgraph.

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"
target triple = "i386-apple-darwin10.0"


define void @list_DeleteElement(i32 (i8*, i8*)* nocapture %Test) nounwind ssp {
entry:
  %0 = call i32 %Test(i8* null, i8* undef) nounwind
  ret void
}


define void @list_DeleteDuplicates(i32 (i8*, i8*)* nocapture %Test) nounwind ssp {
foo:
  call void @list_DeleteElement(i32 (i8*, i8*)* %Test) nounwind ssp 
  call fastcc void @list_Rplacd1284() nounwind ssp
  unreachable

}

define internal i32 @inf_LiteralsHaveSameSubtermAndAreFromSameClause(i32* nocapture %L1, i32* nocapture %L2) nounwind readonly ssp {
entry:
  unreachable
}


define internal fastcc void @inf_GetBackwardPartnerLits(i32* nocapture %Flags) nounwind ssp {
test:
  call void @list_DeleteDuplicates(i32 (i8*, i8*)* bitcast (i32 (i32*, i32*)* @inf_LiteralsHaveSameSubtermAndAreFromSameClause to i32 (i8*, i8*)*)) nounwind 
  ret void
}


define void @inf_BackwardEmptySortPlusPlus() nounwind ssp {
entry:
  call fastcc void @inf_GetBackwardPartnerLits(i32* null) nounwind ssp
  unreachable
}

define void @inf_BackwardWeakening() nounwind ssp {
entry:
  call fastcc void @inf_GetBackwardPartnerLits(i32* null) nounwind ssp
  unreachable
}




declare fastcc void @list_Rplacd1284() nounwind ssp
OpenPOWER on IntegriCloud