summaryrefslogtreecommitdiff
path: root/testsuite/tests
diff options
context:
space:
mode:
authornineonine <mail4chemik@gmail.com>2019-07-13 00:11:46 -0700
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-07-26 00:57:39 -0400
commitaae0457f412aa40dd192ca2cbea565ea60b182ec (patch)
treefd58e2a399fd70e0aeaa9e6c9eb7415877776ba3 /testsuite/tests
parent30b6f391801d58e364f79df5da2cf9f02be2ba5f (diff)
downloadhaskell-aae0457f412aa40dd192ca2cbea565ea60b182ec.tar.gz
Change behaviour of -ddump-cmm-verbose to dump each Cmm pass output to a separate file and add -ddump-cmm-verbose-by-proc to keep old behaviour (#16930)
Diffstat (limited to 'testsuite/tests')
-rw-r--r--testsuite/tests/cmm/should_compile/Makefile12
-rw-r--r--testsuite/tests/cmm/should_compile/T16930.hs10
-rw-r--r--testsuite/tests/cmm/should_compile/T16930.stdout9
-rw-r--r--testsuite/tests/cmm/should_compile/all.T1
-rw-r--r--testsuite/tests/codeGen/should_compile/Makefile4
5 files changed, 34 insertions, 2 deletions
diff --git a/testsuite/tests/cmm/should_compile/Makefile b/testsuite/tests/cmm/should_compile/Makefile
index 9101fbd40a..ac96d11fac 100644
--- a/testsuite/tests/cmm/should_compile/Makefile
+++ b/testsuite/tests/cmm/should_compile/Makefile
@@ -1,3 +1,15 @@
TOP=../../..
include $(TOP)/mk/boilerplate.mk
include $(TOP)/mk/test.mk
+
+## check if -ddump-cmm-verbose -ddump-to-file generates files
+# for all cmm stages and dumps correspond to correct procs
+T16930:
+ echo "testing -ddump-cmm-verbose for T16930 ..."
+ '$(TEST_HC)' $(TEST_HC_OPTS) T16930.hs -fforce-recomp -ddump-cmm-verbose -ddump-to-file
+ grep -rl "CAFEnv" . --include=\T16930.*
+ grep -rl "Post control-flow optimisations" . --include=\T16930.*
+ grep -rl "Post CPS Cmm" . --include=\T16930.*
+ grep -rl "after setInfoTableStackMap" . --include=\T16930.*
+ grep -rl "Layout Stack" . --include=\T16930.*
+ grep -rl "Post switch plan" . --include=\T16930.*
diff --git a/testsuite/tests/cmm/should_compile/T16930.hs b/testsuite/tests/cmm/should_compile/T16930.hs
new file mode 100644
index 0000000000..74aaf0c59f
--- /dev/null
+++ b/testsuite/tests/cmm/should_compile/T16930.hs
@@ -0,0 +1,10 @@
+module Main where
+
+a :: Int
+a = 1
+
+b :: Int
+b = a + 7
+
+main :: IO ()
+main = return ()
diff --git a/testsuite/tests/cmm/should_compile/T16930.stdout b/testsuite/tests/cmm/should_compile/T16930.stdout
new file mode 100644
index 0000000000..bbad2da83f
--- /dev/null
+++ b/testsuite/tests/cmm/should_compile/T16930.stdout
@@ -0,0 +1,9 @@
+testing -ddump-cmm-verbose for T16930 ...
+[1 of 1] Compiling Main ( T16930.hs, T16930.o )
+Linking T16930 ...
+./T16930.dump-cmm-caf
+./T16930.dump-cmm-cfg
+./T16930.dump-cmm-cps
+./T16930.dump-cmm-info
+./T16930.dump-cmm-sp
+./T16930.dump-cmm-switch
diff --git a/testsuite/tests/cmm/should_compile/all.T b/testsuite/tests/cmm/should_compile/all.T
index 4bfa949a80..46dc86930a 100644
--- a/testsuite/tests/cmm/should_compile/all.T
+++ b/testsuite/tests/cmm/should_compile/all.T
@@ -1,2 +1,3 @@
#
test('selfloop', [cmm_src], compile, [''])
+test('T16930', normal, makefile_test, ['T16930'])
diff --git a/testsuite/tests/codeGen/should_compile/Makefile b/testsuite/tests/codeGen/should_compile/Makefile
index 8aa7917751..bcdefcbaba 100644
--- a/testsuite/tests/codeGen/should_compile/Makefile
+++ b/testsuite/tests/codeGen/should_compile/Makefile
@@ -9,13 +9,13 @@ debug:
# Without optimisations, we should get annotations for basically
# all expressions in the example program.
echo == Dbg ==
- '$(TEST_HC)' $(TEST_HC_OPTS) debug -fforce-recomp -g -ddump-cmm-verbose \
+ '$(TEST_HC)' $(TEST_HC_OPTS) debug -fforce-recomp -g -ddump-cmm-verbose-by-proc \
| grep -o src\<debug.hs:.*\> | sort -u
./debug
# With optimisations we will get fewer annotations.
echo == Dbg -O2 ==
- '$(TEST_HC)' $(TEST_HC_OPTS) debug -fforce-recomp -g -ddump-cmm-verbose -O2 \
+ '$(TEST_HC)' $(TEST_HC_OPTS) debug -fforce-recomp -g -ddump-cmm-verbose-by-proc -O2 \
> debug.cmm
cat debug.cmm | grep -o src\<debug.hs:.*\> | sort -u