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

Unified Diff: tests_lit/llvm2ice_tests/cmp-opt.ll

Issue 205613002: Initial skeleton of Subzero. (Closed) Base URL: https://gerrit.chromium.org/gerrit/p/native_client/pnacl-subzero.git@master
Patch Set: Use non-anonymous structs so that array_lengthof works Created 6 years, 8 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 | « tests_lit/llvm2ice_tests/casts.ll ('k') | tests_lit/llvm2ice_tests/convert.ll » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests_lit/llvm2ice_tests/cmp-opt.ll
diff --git a/tests_lit/llvm2ice_tests/cmp-opt.ll b/tests_lit/llvm2ice_tests/cmp-opt.ll
new file mode 100644
index 0000000000000000000000000000000000000000..15aee2a44ad8b0cae316e046b3ad556b7df33eac
--- /dev/null
+++ b/tests_lit/llvm2ice_tests/cmp-opt.ll
@@ -0,0 +1,41 @@
+; RUIN: %llvm2ice %s | FileCheck %s
+; RUIN: %llvm2ice --verbose none %s | FileCheck --check-prefix=ERRORS %s
+; RUN: %szdiff --llvm2ice=%llvm2ice %s | FileCheck --check-prefix=DUMP %s
+
+define void @testBool(i32 %a, i32 %b) {
+entry:
+ %cmp = icmp slt i32 %a, %b
+ %cmp1 = icmp sgt i32 %a, %b
+ br i1 %cmp, label %if.then, label %if.end
+
+if.then: ; preds = %entry
+ tail call void @use(i1 %cmp)
+ br label %if.end
+
+if.end: ; preds = %if.then, %entry
+ br i1 %cmp1, label %if.then5, label %if.end7
+
+if.then5: ; preds = %if.end
+ tail call void @use(i1 %cmp1)
+ br label %if.end7
+
+if.end7: ; preds = %if.then5, %if.end
+ ret void
+}
+
+declare void @use(i1 zeroext)
+
+; ERRORS-NOT: ICE translation error
+
+; CHECK: .globl testBool
+; Two bool computations
+; CHECK: cmp
+; CHECK: cmp
+; Test first bool
+; CHECK: cmp
+; CHECK: call
+; Test second bool
+; CHECK: cmp
+; CHECK: call
+; CHECK: ret
+; DUMP-NOT: SZ
« no previous file with comments | « tests_lit/llvm2ice_tests/casts.ll ('k') | tests_lit/llvm2ice_tests/convert.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698