summaryrefslogtreecommitdiff
path: root/testsuite/tests/cmm
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/cmm')
-rw-r--r--testsuite/tests/cmm/opt/Makefile6
-rw-r--r--testsuite/tests/cmm/opt/T15188.cmm6
-rw-r--r--testsuite/tests/cmm/opt/T15188.stdout1
-rw-r--r--testsuite/tests/cmm/opt/all.T3
4 files changed, 16 insertions, 0 deletions
diff --git a/testsuite/tests/cmm/opt/Makefile b/testsuite/tests/cmm/opt/Makefile
new file mode 100644
index 0000000000..3c462ec0c0
--- /dev/null
+++ b/testsuite/tests/cmm/opt/Makefile
@@ -0,0 +1,6 @@
+TOP=../../..
+include $(TOP)/mk/boilerplate.mk
+include $(TOP)/mk/test.mk
+
+T15188:
+ '$(TEST_HC)' $(TEST_HC_OPTS) -c -O -ddump-cmm-cps -dsuppress-all T15188.cmm | grep if ; echo $$?
diff --git a/testsuite/tests/cmm/opt/T15188.cmm b/testsuite/tests/cmm/opt/T15188.cmm
new file mode 100644
index 0000000000..59df92d78e
--- /dev/null
+++ b/testsuite/tests/cmm/opt/T15188.cmm
@@ -0,0 +1,6 @@
+func(bits64 r2) {
+ foo:
+ if (r2 == 0) { goto bar; } else { goto bar; }
+ bar:
+ return (1);
+}
diff --git a/testsuite/tests/cmm/opt/T15188.stdout b/testsuite/tests/cmm/opt/T15188.stdout
new file mode 100644
index 0000000000..d00491fd7e
--- /dev/null
+++ b/testsuite/tests/cmm/opt/T15188.stdout
@@ -0,0 +1 @@
+1
diff --git a/testsuite/tests/cmm/opt/all.T b/testsuite/tests/cmm/opt/all.T
new file mode 100644
index 0000000000..b2c0f5f8e7
--- /dev/null
+++ b/testsuite/tests/cmm/opt/all.T
@@ -0,0 +1,3 @@
+# Verify that we optimize away conditional branches which always jump
+# to the same target.
+test('T15188', normal, run_command, ['$MAKE -s --no-print-directory T15188'])