1 ; RUN: llvm-upgrade < %s | llvm-as | opt -tailduplicate | \
2 ; RUN: llc -march=x86 -o %t -f
3 ; RUN: grep {\\\<je\\\>} %t
6 ; This should have no unconditional jumps in it. The C source is:
8 ;void foo(int c, int* P) {
10 ; if (c & 2) P[1] = 1;
11 ; if (c & 4) P[2] = 1;
12 ; if (c & 8) P[3] = 1;
17 void %foo(int %c, int* %P) {
19 %tmp1 = and int %c, 1 ; <int> [#uses=1]
20 %tmp1 = seteq int %tmp1, 0 ; <bool> [#uses=1]
21 br bool %tmp1, label %cond_next, label %cond_true
23 cond_true: ; preds = %entry
27 cond_next: ; preds = %entry, %cond_true
28 %tmp5 = and int %c, 2 ; <int> [#uses=1]
29 %tmp5 = seteq int %tmp5, 0 ; <bool> [#uses=1]
30 br bool %tmp5, label %cond_next10, label %cond_true6
32 cond_true6: ; preds = %cond_next
33 %tmp8 = getelementptr int* %P, int 1 ; <int*> [#uses=1]
34 store int 1, int* %tmp8
37 cond_next10: ; preds = %cond_next, %cond_true6
38 %tmp13 = and int %c, 4 ; <int> [#uses=1]
39 %tmp13 = seteq int %tmp13, 0 ; <bool> [#uses=1]
40 br bool %tmp13, label %cond_next18, label %cond_true14
42 cond_true14: ; preds = %cond_next10
43 %tmp16 = getelementptr int* %P, int 2 ; <int*> [#uses=1]
44 store int 1, int* %tmp16
47 cond_next18: ; preds = %cond_next10, %cond_true14
48 %tmp21 = and int %c, 8 ; <int> [#uses=1]
49 %tmp21 = seteq int %tmp21, 0 ; <bool> [#uses=1]
50 br bool %tmp21, label %return, label %cond_true22
52 cond_true22: ; preds = %cond_next18
53 %tmp24 = getelementptr int* %P, int 3 ; <int*> [#uses=1]
54 store int 1, int* %tmp24
57 return: ; preds = %cond_next18