summaryrefslogtreecommitdiff
path: root/testsuite/tests/driver/T1959
diff options
context:
space:
mode:
authorIan Lynagh <ian@well-typed.com>2013-01-25 01:28:17 +0000
committerIan Lynagh <ian@well-typed.com>2013-01-25 01:28:17 +0000
commit4a33b6e89e6e8c89cb0b0ed70685ad7b67240744 (patch)
tree4ae54f60f999858ff6b4649c943fcecc262ce16b /testsuite/tests/driver/T1959
parent3e70ca7a0865f5cf2e7c3134803a4645423da791 (diff)
downloadhaskell-4a33b6e89e6e8c89cb0b0ed70685ad7b67240744.tar.gz
Rename some tests to not start with a digit
Diffstat (limited to 'testsuite/tests/driver/T1959')
-rw-r--r--testsuite/tests/driver/T1959/B.hs6
-rw-r--r--testsuite/tests/driver/T1959/C.hs5
-rw-r--r--testsuite/tests/driver/T1959/D.hs7
-rw-r--r--testsuite/tests/driver/T1959/E1.hs4
-rw-r--r--testsuite/tests/driver/T1959/E2.hs4
-rw-r--r--testsuite/tests/driver/T1959/Makefile29
-rw-r--r--testsuite/tests/driver/T1959/T1959.stdout2
-rw-r--r--testsuite/tests/driver/T1959/test.T5
8 files changed, 62 insertions, 0 deletions
diff --git a/testsuite/tests/driver/T1959/B.hs b/testsuite/tests/driver/T1959/B.hs
new file mode 100644
index 0000000000..8523c17bb4
--- /dev/null
+++ b/testsuite/tests/driver/T1959/B.hs
@@ -0,0 +1,6 @@
+module Main where
+
+import C (x)
+import GHC.Exts (inline)
+
+main = print (inline x)
diff --git a/testsuite/tests/driver/T1959/C.hs b/testsuite/tests/driver/T1959/C.hs
new file mode 100644
index 0000000000..9106a32495
--- /dev/null
+++ b/testsuite/tests/driver/T1959/C.hs
@@ -0,0 +1,5 @@
+module C (x) where
+
+import D
+
+x = f 2
diff --git a/testsuite/tests/driver/T1959/D.hs b/testsuite/tests/driver/T1959/D.hs
new file mode 100644
index 0000000000..8ff5b1397d
--- /dev/null
+++ b/testsuite/tests/driver/T1959/D.hs
@@ -0,0 +1,7 @@
+module D (f) where
+
+import E
+
+{-# INLINE f #-}
+f :: Int -> Int
+f x = h x
diff --git a/testsuite/tests/driver/T1959/E1.hs b/testsuite/tests/driver/T1959/E1.hs
new file mode 100644
index 0000000000..1efb41b3e4
--- /dev/null
+++ b/testsuite/tests/driver/T1959/E1.hs
@@ -0,0 +1,4 @@
+module E (h) where
+
+h :: Int -> Int
+h x = x + x + x + x + x + x + x + x
diff --git a/testsuite/tests/driver/T1959/E2.hs b/testsuite/tests/driver/T1959/E2.hs
new file mode 100644
index 0000000000..cb0ca32ad0
--- /dev/null
+++ b/testsuite/tests/driver/T1959/E2.hs
@@ -0,0 +1,4 @@
+module E (h) where
+
+h :: Int -> Int
+h x = x + x + x + x + x + x + x
diff --git a/testsuite/tests/driver/T1959/Makefile b/testsuite/tests/driver/T1959/Makefile
new file mode 100644
index 0000000000..f7db491d96
--- /dev/null
+++ b/testsuite/tests/driver/T1959/Makefile
@@ -0,0 +1,29 @@
+TOP=../../..
+include $(TOP)/mk/boilerplate.mk
+include $(TOP)/mk/test.mk
+
+# -fforce-recomp makes lots of driver tests trivially pass, so we
+# filter it out from $(TEST_HC_OPTS).
+TEST_HC_OPTS_NO_RECOMP = $(filter-out -fforce-recomp,$(TEST_HC_OPTS))
+
+# Test recompilation bug #1959, which failed in 6.8.1 (and earlier)
+
+compile ::
+ '$(TEST_HC)' $(TEST_HC_OPTS_NO_RECOMP) -c -O E.hs
+ '$(TEST_HC)' $(TEST_HC_OPTS_NO_RECOMP) -c -O D.hs
+ '$(TEST_HC)' $(TEST_HC_OPTS_NO_RECOMP) -c -O -funfolding-use-threshold=0 C.hs
+ '$(TEST_HC)' $(TEST_HC_OPTS_NO_RECOMP) -c -O B.hs
+ '$(TEST_HC)' $(TEST_HC_OPTS_NO_RECOMP) E.o D.o C.o B.o -o prog
+
+clean ::
+ rm -f *.o *.hi E.hs
+
+dotest ::
+ $(MAKE) clean
+ cp E1.hs E.hs
+ $(MAKE) compile
+ ./prog
+ sleep 1
+ cp E2.hs E.hs
+ $(MAKE) compile
+ ./prog
diff --git a/testsuite/tests/driver/T1959/T1959.stdout b/testsuite/tests/driver/T1959/T1959.stdout
new file mode 100644
index 0000000000..3db47397ee
--- /dev/null
+++ b/testsuite/tests/driver/T1959/T1959.stdout
@@ -0,0 +1,2 @@
+16
+14
diff --git a/testsuite/tests/driver/T1959/test.T b/testsuite/tests/driver/T1959/test.T
new file mode 100644
index 0000000000..563206f09b
--- /dev/null
+++ b/testsuite/tests/driver/T1959/test.T
@@ -0,0 +1,5 @@
+test('T1959',
+ extra_clean(['E.hi', 'E.o', 'E.hs', 'prog', 'compile.out',
+ 'B.hi', 'B.o', 'C.hi', 'C.o', 'D.hi', 'D.o']),
+ run_command,
+ ['$MAKE -s --no-print-directory dotest'])