Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(612)

Unified Diff: tests_lit/llvm2ice_tests/branch-simple.ll

Issue 449093002: Subzero: A few fixes toward running larger programs. (Closed) Base URL: https://gerrit.chromium.org/gerrit/p/native_client/pnacl-subzero.git@master
Patch Set: Fix "make format-diff", and run it Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/llvm2ice.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests_lit/llvm2ice_tests/branch-simple.ll
diff --git a/tests_lit/llvm2ice_tests/branch-simple.ll b/tests_lit/llvm2ice_tests/branch-simple.ll
index 6702790c298bd0948a5ac2b29521b873e504df6b..c054a14ae76154f586d9d58627bcce1e17583890 100644
--- a/tests_lit/llvm2ice_tests/branch-simple.ll
+++ b/tests_lit/llvm2ice_tests/branch-simple.ll
@@ -1,7 +1,11 @@
-; Trivial smoke test of compare and branch, with multiple basic
+; 1. Trivial smoke test of compare and branch, with multiple basic
; blocks.
+; 2. For a conditional branch on a constant boolean value, make sure
+; we don't lower to a cmp instructions with an immediate as the first
+; source operand.
-; RUN: %llvm2ice %s --verbose inst | FileCheck %s
+; RUN: %llvm2ice -O2 --verbose inst %s | FileCheck %s
+; RUN: %llvm2ice -Om1 --verbose inst %s | FileCheck %s
; RUN: %llvm2ice --verbose none %s | FileCheck --check-prefix=ERRORS %s
; RUN: %llvm2iceinsts %s | %szdiff %s | FileCheck --check-prefix=DUMP %s
; RUN: %llvm2iceinsts --pnacl %s | %szdiff %s \
@@ -15,6 +19,7 @@ Equal:
ret i32 %foo
Unequal:
ret i32 %bar
+; CHECK-LABEL: simple_cond_branch
; CHECK: br i1 %r1, label %Equal, label %Unequal
; CHECK: Equal:
; CHECK: ret i32 %foo
@@ -22,5 +27,16 @@ Unequal:
; CHECK: ret i32 %bar
}
+define internal i32 @test_br_const() {
+__0:
+ br i1 1, label %__1, label %__2
+__1:
+ ret i32 21
+__2:
+ ret i32 43
+}
+; CHECK-LABEL: test_br_const
+; CHECK-NOT: cmp {{[0-9]*}},
+
; ERRORS-NOT: ICE translation error
; DUMP-NOT: SZ
« no previous file with comments | « src/llvm2ice.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698