summaryrefslogtreecommitdiff
path: root/testsuite/tests/ghc-regress/driver/1959
diff options
context:
space:
mode:
authorSimon Marlow <simonmar@microsoft.com>2007-12-05 15:20:25 +0000
committerSimon Marlow <simonmar@microsoft.com>2007-12-05 15:20:25 +0000
commit4d11ac39d829b759a12660364eb147d5e1eab3d1 (patch)
treeeeab4bc813b17bdcbe13d678e605fcb49ec0c0ab /testsuite/tests/ghc-regress/driver/1959
parentc5cbe3fe68584821ce25b34351c77fcdd0151b14 (diff)
downloadhaskell-4d11ac39d829b759a12660364eb147d5e1eab3d1.tar.gz
add test for #1959
Diffstat (limited to 'testsuite/tests/ghc-regress/driver/1959')
-rw-r--r--testsuite/tests/ghc-regress/driver/1959/1959.stdout2
-rw-r--r--testsuite/tests/ghc-regress/driver/1959/B.hs6
-rw-r--r--testsuite/tests/ghc-regress/driver/1959/C.hs5
-rw-r--r--testsuite/tests/ghc-regress/driver/1959/D.hs7
-rw-r--r--testsuite/tests/ghc-regress/driver/1959/E1.hs4
-rw-r--r--testsuite/tests/ghc-regress/driver/1959/E2.hs4
-rw-r--r--testsuite/tests/ghc-regress/driver/1959/Makefile25
-rw-r--r--testsuite/tests/ghc-regress/driver/1959/test.T1
8 files changed, 54 insertions, 0 deletions
diff --git a/testsuite/tests/ghc-regress/driver/1959/1959.stdout b/testsuite/tests/ghc-regress/driver/1959/1959.stdout
new file mode 100644
index 0000000000..3db47397ee
--- /dev/null
+++ b/testsuite/tests/ghc-regress/driver/1959/1959.stdout
@@ -0,0 +1,2 @@
+16
+14
diff --git a/testsuite/tests/ghc-regress/driver/1959/B.hs b/testsuite/tests/ghc-regress/driver/1959/B.hs
new file mode 100644
index 0000000000..f7f1eab5fa
--- /dev/null
+++ b/testsuite/tests/ghc-regress/driver/1959/B.hs
@@ -0,0 +1,6 @@
+module Main where
+
+import C (x)
+import GHC.Base (inline)
+
+main = print (inline x)
diff --git a/testsuite/tests/ghc-regress/driver/1959/C.hs b/testsuite/tests/ghc-regress/driver/1959/C.hs
new file mode 100644
index 0000000000..9106a32495
--- /dev/null
+++ b/testsuite/tests/ghc-regress/driver/1959/C.hs
@@ -0,0 +1,5 @@
+module C (x) where
+
+import D
+
+x = f 2
diff --git a/testsuite/tests/ghc-regress/driver/1959/D.hs b/testsuite/tests/ghc-regress/driver/1959/D.hs
new file mode 100644
index 0000000000..8ff5b1397d
--- /dev/null
+++ b/testsuite/tests/ghc-regress/driver/1959/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/ghc-regress/driver/1959/E1.hs b/testsuite/tests/ghc-regress/driver/1959/E1.hs
new file mode 100644
index 0000000000..1efb41b3e4
--- /dev/null
+++ b/testsuite/tests/ghc-regress/driver/1959/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/ghc-regress/driver/1959/E2.hs b/testsuite/tests/ghc-regress/driver/1959/E2.hs
new file mode 100644
index 0000000000..cb0ca32ad0
--- /dev/null
+++ b/testsuite/tests/ghc-regress/driver/1959/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/ghc-regress/driver/1959/Makefile b/testsuite/tests/ghc-regress/driver/1959/Makefile
new file mode 100644
index 0000000000..326e44512c
--- /dev/null
+++ b/testsuite/tests/ghc-regress/driver/1959/Makefile
@@ -0,0 +1,25 @@
+TOP=../../../..
+include $(TOP)/mk/boilerplate.mk
+include $(TOP)/mk/test.mk
+
+# Test recompilation bug #1959, which failed in 6.8.1 (and earlier)
+
+compile ::
+ $(TEST_HC) -c -O E.hs
+ $(TEST_HC) -c -O D.hs
+ $(TEST_HC) -c -O -funfolding-use-threshold=0 C.hs
+ $(TEST_HC) -c -O B.hs
+ $(TEST_HC) E.o D.o C.o B.o -o prog
+
+clean ::
+ rm -f *.o *.hi E.hs
+
+dotest ::
+ @$(MAKE) clean >compile.out 2>&1
+ @cp E1.hs E.hs
+ @$(MAKE) compile >compile.out 2>&1
+ ./prog
+ @sleep 1
+ @cp E2.hs E.hs
+ @$(MAKE) compile >compile.out 2>&1
+ ./prog
diff --git a/testsuite/tests/ghc-regress/driver/1959/test.T b/testsuite/tests/ghc-regress/driver/1959/test.T
new file mode 100644
index 0000000000..aa1a69578b
--- /dev/null
+++ b/testsuite/tests/ghc-regress/driver/1959/test.T
@@ -0,0 +1 @@
+test('1959', expect_broken(1959), run_command, ['$MAKE -s --no-print-directory dotest'])