summaryrefslogtreecommitdiff
path: root/test/Transforms/InstSimplify/AndOrXor.ll
diff options
context:
space:
mode:
Diffstat (limited to 'test/Transforms/InstSimplify/AndOrXor.ll')
-rw-r--r--test/Transforms/InstSimplify/AndOrXor.ll12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/Transforms/InstSimplify/AndOrXor.ll b/test/Transforms/InstSimplify/AndOrXor.ll
new file mode 100644
index 0000000000..3d04d584f4
--- /dev/null
+++ b/test/Transforms/InstSimplify/AndOrXor.ll
@@ -0,0 +1,12 @@
+; RUN: opt < %s -instsimplify -S | FileCheck %s
+
+define i64 @pow2(i32 %x) {
+; CHECK: @pow2
+ %negx = sub i32 0, %x
+ %x2 = and i32 %x, %negx
+ %e = zext i32 %x2 to i64
+ %nege = sub i64 0, %e
+ %e2 = and i64 %e, %nege
+ ret i64 %e2
+; CHECK: ret i64 %e
+}