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

Unified Diff: test/NaCl/PNaClABI/instcombine.ll

Issue 939073008: Rebased PNaCl localmods in LLVM to 223109 (Closed)
Patch Set: undo localmod Created 5 years, 10 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 | « test/NaCl/PNaClABI/global-attributes.ll ('k') | test/NaCl/PNaClABI/instructions.ll » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/NaCl/PNaClABI/instcombine.ll
diff --git a/test/NaCl/PNaClABI/instcombine.ll b/test/NaCl/PNaClABI/instcombine.ll
new file mode 100644
index 0000000000000000000000000000000000000000..e21eea45c4a52b0767307096e1ad2efb97dee0bc
--- /dev/null
+++ b/test/NaCl/PNaClABI/instcombine.ll
@@ -0,0 +1,24 @@
+; RUN: opt < %s -instcombine -S | FileCheck %s
+; Test that instcombine does not introduce non-power-of-two integers into
+; the module
+
+target datalayout = "p:32:32:32"
+
+; This test is a counterpart to icmp_shl16 in
+; test/Transforms/InstCombine/icmp.ll, which should still pass.
+; CHECK: @icmp_shl31
+; CHECK-NOT: i31
+define i1 @icmp_shl31(i32 %x) {
+ %shl = shl i32 %x, 1
+ %cmp = icmp slt i32 %shl, 36
+ ret i1 %cmp
+}
+
+; Check that we don't introduce i4, which is a power of 2 but still not allowed.
+; CHECK: @icmp_shl4
+; CHECK-NOT: i4
+define i1 @icmp_shl4(i32 %x) {
+ %shl = shl i32 %x, 28
+ %cmp = icmp slt i32 %shl, 1073741824
+ ret i1 %cmp
+}
« no previous file with comments | « test/NaCl/PNaClABI/global-attributes.ll ('k') | test/NaCl/PNaClABI/instructions.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698