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

Unified Diff: tests_lit/llvm2ice_tests/arith.ll

Issue 1262003003: Subzero: Fix x86 lowering for shift-by-relocatable-constant. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 5 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/IceTargetLoweringX86BaseImpl.h ('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/arith.ll
diff --git a/tests_lit/llvm2ice_tests/arith.ll b/tests_lit/llvm2ice_tests/arith.ll
index 3fbdab6d09e90d8f363f3174fdaa53eac622ece5..3027ee28fb552934ebdff36cc8591c7118a38e24 100644
--- a/tests_lit/llvm2ice_tests/arith.ll
+++ b/tests_lit/llvm2ice_tests/arith.ll
@@ -207,3 +207,35 @@ entry:
; ARM32HWDIV: bne
; ARM32HWDIV: udiv
; ARM32HWDIV: mls
+
+; The following tests check that shift instructions don't try to use a
+; ConstantRelocatable as an immediate operand.
+
+@G = internal global [4 x i8] zeroinitializer, align 4
+
+define i32 @ShlReloc(i32 %a) {
+entry:
+ %opnd = ptrtoint [4 x i8]* @G to i32
+ %result = shl i32 %a, %opnd
+ ret i32 %result
+}
+; CHECK-LABEL: ShlReloc
+; CHECK: shl {{.*}},cl
jvoung (off chromium) 2015/08/04 21:21:51 Yeah I agree with the reloc awkwardness, especiall
+
+define i32 @LshrReloc(i32 %a) {
+entry:
+ %opnd = ptrtoint [4 x i8]* @G to i32
+ %result = lshr i32 %a, %opnd
+ ret i32 %result
+}
+; CHECK-LABEL: LshrReloc
+; CHECK: shr {{.*}},cl
+
+define i32 @AshrReloc(i32 %a) {
+entry:
+ %opnd = ptrtoint [4 x i8]* @G to i32
+ %result = ashr i32 %a, %opnd
+ ret i32 %result
+}
+; CHECK-LABEL: AshrReloc
+; CHECK: sar {{.*}},cl
« no previous file with comments | « src/IceTargetLoweringX86BaseImpl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698