diff mbox

[05/10] bool: add testcase for bool simplification

Message ID 20180626060002.35753-6-luc.vanoostenryck@gmail.com (mailing list archive)
State Mainlined, archived
Headers show

Commit Message

Luc Van Oostenryck June 26, 2018, 5:59 a.m. UTC
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
 validation/optim/bool-simplify2.c | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)
 create mode 100644 validation/optim/bool-simplify2.c
diff mbox

Patch

diff --git a/validation/optim/bool-simplify2.c b/validation/optim/bool-simplify2.c
new file mode 100644
index 000000000..7e7548fc5
--- /dev/null
+++ b/validation/optim/bool-simplify2.c
@@ -0,0 +1,29 @@ 
+static int foo(int a, int b, int c)
+{
+	return a || b || c;
+}
+
+/*
+ * check-name: bool-simplify2
+ * check-command: test-linearize $file
+ *
+ * check-output-pattern(4): setne\\.
+ * check-output-pattern(2): zext\\.
+ *
+ * check-output-start
+foo:
+.L0:
+	<entry-point>
+	setne.1     %r2 <- %arg1, $0
+	setne.1     %r4 <- %arg2, $0
+	or-bool.1   %r5 <- %r2, %r4
+	zext.32     %r6 <- (1) %r5
+	setne.1     %r7 <- %r6, $0
+	setne.1     %r9 <- %arg3, $0
+	or-bool.1   %r10 <- %r7, %r9
+	zext.32     %r11 <- (1) %r10
+	ret.32      %r11
+
+
+ * check-output-end
+ */