Chromium Code Reviews| Index: tests_lit/llvm2ice_tests/cond-br-same-target.ll |
| diff --git a/tests_lit/llvm2ice_tests/cond-br-same-target.ll b/tests_lit/llvm2ice_tests/cond-br-same-target.ll |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..77ecae0703e5630e34d71b553f92cc613d1c9428 |
| --- /dev/null |
| +++ b/tests_lit/llvm2ice_tests/cond-br-same-target.ll |
| @@ -0,0 +1,32 @@ |
| +; Test conditional branch where targets are the same. |
| +; Tests issue: https://code.google.com/p/nativeclient/issues/detail?id=4212 |
| + |
| +; RUN: %p2i -i %s --args -O2 --verbose inst -threads=0 | FileCheck %s |
|
Jim Stichnoth
2015/06/25 21:26:29
You should be able to use "--insts" instead of "--
Karl
2015/06/25 22:33:42
Done.
|
| + |
| +define void @f(i32 %foo, i32 %bar) { |
| + %c = icmp ult i32 %foo, %bar |
| + br i1 %c, label %block, label %block |
| +block: |
| + ret void |
| +} |
| + |
| +; The following shows that the input is parsed correctly. |
|
Jim Stichnoth
2015/06/25 21:26:29
Actually, it shows that conditional has already be
Karl
2015/06/25 22:33:42
Correct. The test now shows it.
|
| + |
| +; CHECK: ================ Initial CFG ================ |
|
Jim Stichnoth
2015/06/25 21:26:29
Probably better not to check for this header, whic
Karl
2015/06/25 22:33:42
Removed.
|
| +; CHECK-NEXT: define void @f(i32 %foo, i32 %bar) { |
| +; CHECK-NEXT: __0: |
| +; CHECK-NEXT: %c = icmp ult i32 %foo, %bar |
| +; CHECK-NEXT: br label %block |
| +; CHECK-NEXT: block: |
| +; CHECK-NEXT: ret void |
| +; CHECK-NEXT: } |
| + |
| +; The following shows the conditional branch is converted to unconditional. |
|
Jim Stichnoth
2015/06/25 21:26:30
Given my earlier comment, I don't think this latte
Karl
2015/06/25 22:33:42
Removed.
|
| + |
| +; CHECK: ================ After x86 address mode opt ================ |
| +; CHECK-NEXT: define void @f(i32 %foo, i32 %bar) { |
| +; CHECK-NEXT: __0: |
| +; CHECK-NEXT: br label %block |
| +; CHECK-NEXT: block: |
| +; CHECK-NEXT: ret void |
| +; CHECK-NEXT: } |