1 ; RUN: llvm-as < %s | opt -tailduplicate | llc -march=x86 | grep 'je ' &&
2 ; RUN: llvm-as < %s | opt -tailduplicate | llc -march=x86 | not grep jmp
3 ; This should have no unconditional jumps in it. The C source is:
5 ;void foo(int c, int* P) {
13 void %foo(int %c, int* %P) {
15 %tmp1 = and int %c, 1 ; <int> [#uses=1]
16 %tmp1 = seteq int %tmp1, 0 ; <bool> [#uses=1]
17 br bool %tmp1, label %cond_next, label %cond_true
19 cond_true: ; preds = %entry
23 cond_next: ; preds = %entry, %cond_true
24 %tmp5 = and int %c, 2 ; <int> [#uses=1]
25 %tmp5 = seteq int %tmp5, 0 ; <bool> [#uses=1]
26 br bool %tmp5, label %cond_next10, label %cond_true6
28 cond_true6: ; preds = %cond_next
29 %tmp8 = getelementptr int* %P, int 1 ; <int*> [#uses=1]
30 store int 1, int* %tmp8
33 cond_next10: ; preds = %cond_next, %cond_true6
34 %tmp13 = and int %c, 4 ; <int> [#uses=1]
35 %tmp13 = seteq int %tmp13, 0 ; <bool> [#uses=1]
36 br bool %tmp13, label %cond_next18, label %cond_true14
38 cond_true14: ; preds = %cond_next10
39 %tmp16 = getelementptr int* %P, int 2 ; <int*> [#uses=1]
40 store int 1, int* %tmp16
43 cond_next18: ; preds = %cond_next10, %cond_true14
44 %tmp21 = and int %c, 8 ; <int> [#uses=1]
45 %tmp21 = seteq int %tmp21, 0 ; <bool> [#uses=1]
46 br bool %tmp21, label %return, label %cond_true22
48 cond_true22: ; preds = %cond_next18
49 %tmp24 = getelementptr int* %P, int 3 ; <int*> [#uses=1]
50 store int 1, int* %tmp24
53 return: ; preds = %cond_next18