summaryrefslogtreecommitdiffstats
path: root/test/Transforms/InstSimplify/2010-12-20-Boolean.ll
diff options
context:
space:
mode:
Diffstat (limited to 'test/Transforms/InstSimplify/2010-12-20-Boolean.ll')
-rw-r--r--test/Transforms/InstSimplify/2010-12-20-Boolean.ll29
1 files changed, 29 insertions, 0 deletions
diff --git a/test/Transforms/InstSimplify/2010-12-20-Boolean.ll b/test/Transforms/InstSimplify/2010-12-20-Boolean.ll
new file mode 100644
index 0000000..3aa1bd6
--- /dev/null
+++ b/test/Transforms/InstSimplify/2010-12-20-Boolean.ll
@@ -0,0 +1,29 @@
+; RUN: opt < %s -instsimplify -S | FileCheck %s
+
+define i1 @add(i1 %x) {
+; CHECK: @add
+ %z = add i1 %x, %x
+ ret i1 %z
+; CHECK: ret i1 false
+}
+
+define i1 @sub(i1 %x) {
+; CHECK: @sub
+ %z = sub i1 false, %x
+ ret i1 %z
+; CHECK: ret i1 %x
+}
+
+define i1 @mul(i1 %x) {
+; CHECK: @mul
+ %z = mul i1 %x, %x
+ ret i1 %z
+; CHECK: ret i1 %x
+}
+
+define i1 @ne(i1 %x) {
+; CHECK: @ne
+ %z = icmp ne i1 %x, 0
+ ret i1 %z
+; CHECK: ret i1 %x
+}
OpenPOWER on IntegriCloud