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

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

Issue 511543002: Subzero: Fix some legalization issues involving immediates. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Code review changes, first round 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 | « tests_lit/llvm2ice_tests/bool-opt.ll ('k') | tests_lit/llvm2ice_tests/switch-opt.ll » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests_lit/llvm2ice_tests/select-opt.ll
diff --git a/tests_lit/llvm2ice_tests/select-opt.ll b/tests_lit/llvm2ice_tests/select-opt.ll
index 1d2e2e0f45a87f2cc22ef4b0869ce0a18dc78ed7..83a3d42b339401ead82d79af73504e51eb694de1 100644
--- a/tests_lit/llvm2ice_tests/select-opt.ll
+++ b/tests_lit/llvm2ice_tests/select-opt.ll
@@ -36,5 +36,26 @@ declare void @useInt(i32)
; CHECK: call useInt
; CHECK: ret
+; Check for valid addressing mode in the cmp instruction when the
+; operand is an immediate.
+define i32 @testSelectImm32(i32 %a, i32 %b) {
+entry:
+ %cond = select i1 0, i32 %a, i32 %b
+ ret i32 %cond
+}
+; CHECK-LABEL: testSelectImm32
+; CHECK-NOT: cmp {{[0-9]+}},
+
+; Check for valid addressing mode in the cmp instruction when the
+; operand is an immediate. There is a different x86-32 lowering
+; sequence for 64-bit operands.
+define i64 @testSelectImm64(i64 %a, i64 %b) {
+entry:
+ %cond = select i1 1, i64 %a, i64 %b
+ ret i64 %cond
+}
+; CHECK-LABEL: testSelectImm64
+; CHECK-NOT: cmp {{[0-9]+}},
+
; ERRORS-NOT: ICE translation error
; DUMP-NOT: SZ
« no previous file with comments | « tests_lit/llvm2ice_tests/bool-opt.ll ('k') | tests_lit/llvm2ice_tests/switch-opt.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698