aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDerek Schuff <dschuff@chromium.org>2013-09-20 11:28:04 -0700
committerDerek Schuff <dschuff@chromium.org>2013-09-20 11:28:04 -0700
commitc55c3cd39be4c524d0db3ad2f356ea179a2e03b4 (patch)
treea7c0f9e79fdf8fac4994467e2a2b6586770c5c77 /test
parent197cadba6026114ce62ed57dafe2125e70500a6b (diff)
Support mul binary operator in integer promotion pass
Its handling is the same as add (may overflow, may set upper bits) R=jvoung@chromium.org, mseaborn@chromium.org BUG= https://code.google.com/p/nativeclient/issues/detail?id=3599 Review URL: https://codereview.chromium.org/24244008
Diffstat (limited to 'test')
-rw-r--r--test/Transforms/NaCl/promote-integers.ll17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/Transforms/NaCl/promote-integers.ll b/test/Transforms/NaCl/promote-integers.ll
index 7fca6e1078..8d7ebac28e 100644
--- a/test/Transforms/NaCl/promote-integers.ll
+++ b/test/Transforms/NaCl/promote-integers.ll
@@ -168,6 +168,23 @@ define void @add1(i16 %a) {
ret void
}
+; CHECK: @mul1
+define void @mul1(i32 %a, i32 %b) {
+; CHECK-NEXT: %a33.sext = sext i32 %a to i64
+; CHECK-NEXT: %a33 = and i64 %a33.sext, 8589934591
+ %a33 = sext i32 %a to i33
+; CHECK-NEXT: %b33.sext = sext i32 %b to i64
+; CHECK-NEXT: %b33 = and i64 %b33.sext, 8589934591
+ %b33 = sext i32 %b to i33
+; CHECK-NEXT: %product.result = mul i64 %a33, %b33
+; CHECK-NEXT: %product = and i64 %product.result, 8589934591
+ %product = mul i33 %a33, %b33
+; CHECK-NEXT: %prodnw = mul nuw nsw i64 %a33, %b33
+; CHECK-NOT: and
+ %prodnw = mul nuw nsw i33 %a33, %b33
+ ret void
+}
+
; CHECK: @shl1
define void @shl1(i16 %a) {
%a24 = zext i16 %a to i24