94b437c12f02c493f49b68779752db9dac46ce4a
[oota-llvm.git] / test / CodeGen / Generic / 2007-04-14-BitTestsBadMask.ll
1 ; RUN: llvm-as < %s | llc -march=x86 | grep 8388635
2 ; RUN: llvm-as < %s | llc -march=x86-64 | grep 4294981120
3 ; PR 1325
4
5 ; FIXME: this is xfailed until we figure out ppc bootstrap
6 ; XFAIL: *
7
8 ; ModuleID = 'bugpoint.test.bc'
9 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"
10 target triple = "powerpc-apple-darwin8.8.0"
11 ;target triple = "i686-linux-gnu"
12         %struct.FILE = type { i8*, i32, i32, i16, i16, %struct.__sbuf, i32, i8*, i32 (i8*)*, i32 (i8*, i8*, i32)*, i64 (i8*, i64, i32)*, i32 (i8*, i8*, i32)*, %struct.__sbuf, %struct.__sFILEX*, i32, [3 x i8], [1 x i8], %struct.__sbuf, i32, i64 }
13         %struct.__sFILEX = type opaque
14         %struct.__sbuf = type { i8*, i32 }
15 @PL_rsfp = external global %struct.FILE*                ; <%struct.FILE**> [#uses=1]
16 @PL_bufend = external global i8*                ; <i8**> [#uses=1]
17 @PL_in_eval = external global i32               ; <i32*> [#uses=1]
18
19 declare fastcc void @incline(i8*)
20
21 define i16 @Perl_skipspace_bb60(i8* %s, i8** %s_addr.4.out) {
22 newFuncRoot:
23         %tmp138.loc = alloca i8*                ; <i8**> [#uses=2]
24         %s_addr.4.loc = alloca i8*              ; <i8**> [#uses=2]
25         %tmp274.loc = alloca i8*                ; <i8**> [#uses=2]
26         br label %bb60
27
28 cond_next154.UnifiedReturnBlock_crit_edge.exitStub:             ; preds = %codeRepl
29         store i8* %s_addr.4.reload, i8** %s_addr.4.out
30         ret i16 0
31
32 cond_next161.UnifiedReturnBlock_crit_edge.exitStub:             ; preds = %codeRepl
33         store i8* %s_addr.4.reload, i8** %s_addr.4.out
34         ret i16 1
35
36 cond_next167.UnifiedReturnBlock_crit_edge.exitStub:             ; preds = %codeRepl
37         store i8* %s_addr.4.reload, i8** %s_addr.4.out
38         ret i16 2
39
40 cond_false29.i.cond_true190_crit_edge.exitStub:         ; preds = %codeRepl
41         store i8* %s_addr.4.reload, i8** %s_addr.4.out
42         ret i16 3
43
44 cond_next.i.cond_true190_crit_edge.exitStub:            ; preds = %codeRepl
45         store i8* %s_addr.4.reload, i8** %s_addr.4.out
46         ret i16 4
47
48 cond_true19.i.cond_true190_crit_edge.exitStub:          ; preds = %codeRepl
49         store i8* %s_addr.4.reload, i8** %s_addr.4.out
50         ret i16 5
51
52 bb60:           ; preds = %bb60.backedge, %newFuncRoot
53         %s_addr.2 = phi i8* [ %s, %newFuncRoot ], [ %s_addr.2.be, %bb60.backedge ]              ; <i8*> [#uses=3]
54         %tmp61 = load i8** @PL_bufend           ; <i8*> [#uses=1]
55         %tmp63 = icmp ult i8* %s_addr.2, %tmp61         ; <i1> [#uses=1]
56         br i1 %tmp63, label %bb60.cond_next67_crit_edge, label %bb60.bb101_crit_edge
57
58 bb37:           ; preds = %cond_next67.bb37_crit_edge5, %cond_next67.bb37_crit_edge4, %cond_next67.bb37_crit_edge3, %cond_next67.bb37_crit_edge2, %cond_next67.bb37_crit_edge
59         %tmp40 = icmp eq i8 %tmp69, 10          ; <i1> [#uses=1]
60         %tmp43 = getelementptr i8* %s_addr.27.2, i32 1          ; <i8*> [#uses=5]
61         br i1 %tmp40, label %cond_true45, label %bb37.bb60_crit_edge
62
63 cond_true45:            ; preds = %bb37
64         %tmp46 = volatile load i32* @PL_in_eval         ; <i32> [#uses=1]
65         %tmp47 = icmp eq i32 %tmp46, 0          ; <i1> [#uses=1]
66         br i1 %tmp47, label %cond_true45.bb60_crit_edge, label %cond_true50
67
68 cond_true50:            ; preds = %cond_true45
69         %tmp51 = volatile load %struct.FILE** @PL_rsfp          ; <%struct.FILE*> [#uses=1]
70         %tmp52 = icmp eq %struct.FILE* %tmp51, null             ; <i1> [#uses=1]
71         br i1 %tmp52, label %cond_true55, label %cond_true50.bb60_crit_edge
72
73 cond_true55:            ; preds = %cond_true50
74         tail call fastcc void @incline( i8* %tmp43 )
75         br label %bb60.backedge
76
77 cond_next67:            ; preds = %Perl_newSV.exit.cond_next67_crit_edge, %cond_true148.cond_next67_crit_edge, %bb60.cond_next67_crit_edge
78         %s_addr.27.2 = phi i8* [ %s_addr.2, %bb60.cond_next67_crit_edge ], [ %tmp274.reload, %Perl_newSV.exit.cond_next67_crit_edge ], [ %tmp138.reload, %cond_true148.cond_next67_crit_edge ]          ; <i8*> [#uses=3]
79         %tmp69 = load i8* %s_addr.27.2          ; <i8> [#uses=2]
80         switch i8 %tmp69, label %cond_next67.bb101_crit_edge [
81                  i8 32, label %cond_next67.bb37_crit_edge
82                  i8 9, label %cond_next67.bb37_crit_edge2
83                  i8 10, label %cond_next67.bb37_crit_edge3
84                  i8 13, label %cond_next67.bb37_crit_edge4
85                  i8 12, label %cond_next67.bb37_crit_edge5
86         ]
87
88 codeRepl:               ; preds = %bb101.preheader
89         %targetBlock = call i16 @Perl_skipspace_bb60_bb101( i8* %s_addr.27.3.ph, i8** %tmp274.loc, i8** %s_addr.4.loc, i8** %tmp138.loc )               ; <i16> [#uses=1]
90         %tmp274.reload = load i8** %tmp274.loc          ; <i8*> [#uses=4]
91         %s_addr.4.reload = load i8** %s_addr.4.loc              ; <i8*> [#uses=6]
92         %tmp138.reload = load i8** %tmp138.loc          ; <i8*> [#uses=1]
93         switch i16 %targetBlock, label %cond_true19.i.cond_true190_crit_edge.exitStub [
94                  i16 0, label %cond_next271.bb60_crit_edge
95                  i16 1, label %cond_true290.bb60_crit_edge
96                  i16 2, label %cond_true295.bb60_crit_edge
97                  i16 3, label %Perl_newSV.exit.cond_next67_crit_edge
98                  i16 4, label %cond_true148.cond_next67_crit_edge
99                  i16 5, label %cond_next154.UnifiedReturnBlock_crit_edge.exitStub
100                  i16 6, label %cond_next161.UnifiedReturnBlock_crit_edge.exitStub
101                  i16 7, label %cond_next167.UnifiedReturnBlock_crit_edge.exitStub
102                  i16 8, label %cond_false29.i.cond_true190_crit_edge.exitStub
103                  i16 9, label %cond_next.i.cond_true190_crit_edge.exitStub
104         ]
105
106 bb37.bb60_crit_edge:            ; preds = %bb37
107         br label %bb60.backedge
108
109 cond_true45.bb60_crit_edge:             ; preds = %cond_true45
110         br label %bb60.backedge
111
112 cond_true50.bb60_crit_edge:             ; preds = %cond_true50
113         br label %bb60.backedge
114
115 bb60.cond_next67_crit_edge:             ; preds = %bb60
116         br label %cond_next67
117
118 bb60.bb101_crit_edge:           ; preds = %bb60
119         br label %bb101.preheader
120
121 cond_next67.bb101_crit_edge:            ; preds = %cond_next67
122         br label %bb101.preheader
123
124 cond_next67.bb37_crit_edge:             ; preds = %cond_next67
125         br label %bb37
126
127 cond_next67.bb37_crit_edge2:            ; preds = %cond_next67
128         br label %bb37
129
130 cond_next67.bb37_crit_edge3:            ; preds = %cond_next67
131         br label %bb37
132
133 cond_next67.bb37_crit_edge4:            ; preds = %cond_next67
134         br label %bb37
135
136 cond_next67.bb37_crit_edge5:            ; preds = %cond_next67
137         br label %bb37
138
139 cond_true148.cond_next67_crit_edge:             ; preds = %codeRepl
140         br label %cond_next67
141
142 cond_next271.bb60_crit_edge:            ; preds = %codeRepl
143         br label %bb60.backedge
144
145 cond_true290.bb60_crit_edge:            ; preds = %codeRepl
146         br label %bb60.backedge
147
148 cond_true295.bb60_crit_edge:            ; preds = %codeRepl
149         br label %bb60.backedge
150
151 Perl_newSV.exit.cond_next67_crit_edge:          ; preds = %codeRepl
152         br label %cond_next67
153
154 bb101.preheader:                ; preds = %cond_next67.bb101_crit_edge, %bb60.bb101_crit_edge
155         %s_addr.27.3.ph = phi i8* [ %s_addr.27.2, %cond_next67.bb101_crit_edge ], [ %s_addr.2, %bb60.bb101_crit_edge ]          ; <i8*> [#uses=1]
156         br label %codeRepl
157
158 bb60.backedge:          ; preds = %cond_true295.bb60_crit_edge, %cond_true290.bb60_crit_edge, %cond_next271.bb60_crit_edge, %cond_true50.bb60_crit_edge, %cond_true45.bb60_crit_edge, %bb37.bb60_crit_edge, %cond_true55
159         %s_addr.2.be = phi i8* [ %tmp43, %cond_true55 ], [ %tmp43, %bb37.bb60_crit_edge ], [ %tmp43, %cond_true45.bb60_crit_edge ], [ %tmp43, %cond_true50.bb60_crit_edge ], [ %tmp274.reload, %cond_next271.bb60_crit_edge ], [ %tmp274.reload, %cond_true290.bb60_crit_edge ], [ %tmp274.reload, %cond_true295.bb60_crit_edge ]               ; <i8*> [#uses=1]
160         br label %bb60
161 }
162
163 declare i16 @Perl_skipspace_bb60_bb101(i8*, i8**, i8**, i8**)