disable value insertion for now, I need to figure out how
[oota-llvm.git] / test / Transforms / GVN / crash.ll
1 ; RUN: opt -gvn %s -disable-output
2
3 ; PR5631
4
5 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
6 target triple = "x86_64-apple-darwin10.0"
7
8 define i32* @peel_to_type(i8* %name, i32 %namelen, i32* %o, i32 %expected_type) nounwind ssp {
9 entry:
10   br i1 undef, label %if.end13, label %while.body.preheader
11
12
13 if.end13:                                         ; preds = %if.then6
14   br label %while.body.preheader
15
16 while.body.preheader:                             ; preds = %if.end13, %if.end
17   br label %while.body
18
19 while.body:                                       ; preds = %while.body.backedge, %while.body.preheader
20   %o.addr.0 = phi i32* [ undef, %while.body.preheader ], [ %o.addr.0.be, %while.body.backedge ] ; <i32*> [#uses=2]
21   br i1 false, label %return.loopexit, label %lor.lhs.false
22
23 lor.lhs.false:                                    ; preds = %while.body
24   %tmp20 = bitcast i32* %o.addr.0 to i32*         ; <i32*> [#uses=1]
25   %tmp22 = load i32* %tmp20                       ; <i32> [#uses=0]
26   br i1 undef, label %land.lhs.true24, label %if.end31
27
28 land.lhs.true24:                                  ; preds = %lor.lhs.false
29   %call28 = call i32* @parse_object(i8* undef) nounwind ; <i32*> [#uses=0]
30   br i1 undef, label %return.loopexit, label %if.end31
31
32 if.end31:                                         ; preds = %land.lhs.true24, %lor.lhs.false
33   br i1 undef, label %return.loopexit, label %if.end41
34
35 if.end41:                                         ; preds = %if.end31
36   %tmp43 = bitcast i32* %o.addr.0 to i32*         ; <i32*> [#uses=1]
37   %tmp45 = load i32* %tmp43                       ; <i32> [#uses=0]
38   br i1 undef, label %if.then50, label %if.else
39
40 if.then50:                                        ; preds = %if.end41
41   %tmp53 = load i32** undef                       ; <i32*> [#uses=1]
42   br label %while.body.backedge
43
44 if.else:                                          ; preds = %if.end41
45   br i1 undef, label %if.then62, label %if.else67
46
47 if.then62:                                        ; preds = %if.else
48   br label %while.body.backedge
49
50 while.body.backedge:                              ; preds = %if.then62, %if.then50
51   %o.addr.0.be = phi i32* [ %tmp53, %if.then50 ], [ undef, %if.then62 ] ; <i32*> [#uses=1]
52   br label %while.body
53
54 if.else67:                                        ; preds = %if.else
55   ret i32* null
56
57 return.loopexit:                                  ; preds = %if.end31, %land.lhs.true24, %while.body
58   ret i32* undef
59 }
60
61 declare i32* @parse_object(i8*)