1 ; RUN: llvm-upgrade < %s | llvm-as | opt -tailduplicate | llc -march=x86 | grep 'je ' &&
2 ; RUN: llvm-upgrade < %s | llvm-as | 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) {
14 void %foo(int %c, int* %P) {
16 %tmp1 = and int %c, 1 ; <int> [#uses=1]
17 %tmp1 = seteq int %tmp1, 0 ; <bool> [#uses=1]
18 br bool %tmp1, label %cond_next, label %cond_true
20 cond_true: ; preds = %entry
24 cond_next: ; preds = %entry, %cond_true
25 %tmp5 = and int %c, 2 ; <int> [#uses=1]
26 %tmp5 = seteq int %tmp5, 0 ; <bool> [#uses=1]
27 br bool %tmp5, label %cond_next10, label %cond_true6
29 cond_true6: ; preds = %cond_next
30 %tmp8 = getelementptr int* %P, int 1 ; <int*> [#uses=1]
31 store int 1, int* %tmp8
34 cond_next10: ; preds = %cond_next, %cond_true6
35 %tmp13 = and int %c, 4 ; <int> [#uses=1]
36 %tmp13 = seteq int %tmp13, 0 ; <bool> [#uses=1]
37 br bool %tmp13, label %cond_next18, label %cond_true14
39 cond_true14: ; preds = %cond_next10
40 %tmp16 = getelementptr int* %P, int 2 ; <int*> [#uses=1]
41 store int 1, int* %tmp16
44 cond_next18: ; preds = %cond_next10, %cond_true14
45 %tmp21 = and int %c, 8 ; <int> [#uses=1]
46 %tmp21 = seteq int %tmp21, 0 ; <bool> [#uses=1]
47 br bool %tmp21, label %return, label %cond_true22
49 cond_true22: ; preds = %cond_next18
50 %tmp24 = getelementptr int* %P, int 3 ; <int*> [#uses=1]
51 store int 1, int* %tmp24
54 return: ; preds = %cond_next18