aboutsummaryrefslogtreecommitdiffstats
path: root/test/Transforms/Reassociate/min_int.ll
diff options
context:
space:
mode:
Diffstat (limited to 'test/Transforms/Reassociate/min_int.ll')
-rw-r--r--test/Transforms/Reassociate/min_int.ll13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/Transforms/Reassociate/min_int.ll b/test/Transforms/Reassociate/min_int.ll
new file mode 100644
index 0000000..52dab3a
--- /dev/null
+++ b/test/Transforms/Reassociate/min_int.ll
@@ -0,0 +1,13 @@
+; RUN: opt < %s -reassociate -dce -S | FileCheck %s
+
+; MIN_INT cannot be negated during reassociation
+
+define i32 @minint(i32 %i) {
+; CHECK: %mul = mul i32 %i, -2147483648
+; CHECK-NEXT: %add = add i32 %mul, 1
+; CHECK-NEXT: ret i32 %add
+ %mul = mul i32 %i, -2147483648
+ %add = add i32 %mul, 1
+ ret i32 %add
+}
+