[commit: ghc] master: Add a failing test for #13099 (b476131)

git at git.haskell.org git at git.haskell.org
Fri Jan 20 21:45:31 UTC 2017


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/b47613178232f8e849ac58ebd4111a34ab9c140b/ghc

>---------------------------------------------------------------

commit b47613178232f8e849ac58ebd4111a34ab9c140b
Author: Reid Barton <rwbarton at gmail.com>
Date:   Fri Jan 20 15:03:44 2017 -0500

    Add a failing test for #13099
    
    Reviewers: austin, bgamari
    
    Reviewed By: bgamari
    
    Subscribers: thomie
    
    Differential Revision: https://phabricator.haskell.org/D2990
    
    GHC Trac Issues: #13099


>---------------------------------------------------------------

b47613178232f8e849ac58ebd4111a34ab9c140b
 .../T11062.hs-boot => driver/recomp017/A.hs}        |  2 +-
 testsuite/tests/driver/recomp017/B.hs               |  7 +++++++
 testsuite/tests/driver/recomp017/C.hs               |  5 +++++
 testsuite/tests/driver/recomp017/C2.hs              |  5 +++++
 testsuite/tests/driver/recomp017/D.hs               |  3 +++
 testsuite/tests/driver/recomp017/E.hs               | 10 ++++++++++
 testsuite/tests/driver/recomp017/Makefile           | 21 +++++++++++++++++++++
 testsuite/tests/driver/recomp017/all.T              | 11 +++++++++++
 8 files changed, 63 insertions(+), 1 deletion(-)

diff --git a/testsuite/tests/typecheck/should_compile/T11062.hs-boot b/testsuite/tests/driver/recomp017/A.hs
similarity index 69%
copy from testsuite/tests/typecheck/should_compile/T11062.hs-boot
copy to testsuite/tests/driver/recomp017/A.hs
index fb56005..8f9d7c1 100644
--- a/testsuite/tests/typecheck/should_compile/T11062.hs-boot
+++ b/testsuite/tests/driver/recomp017/A.hs
@@ -1,3 +1,3 @@
 {-# LANGUAGE TypeFamilies #-}
-module T11062 where
+module A where
 type family F a
diff --git a/testsuite/tests/driver/recomp017/B.hs b/testsuite/tests/driver/recomp017/B.hs
new file mode 100644
index 0000000..10f8423
--- /dev/null
+++ b/testsuite/tests/driver/recomp017/B.hs
@@ -0,0 +1,7 @@
+{-# LANGUAGE TypeFamilies #-}
+module B where
+import A
+data B
+type instance F (B,b) = ()
+b :: () -> F (B,b)
+b = id
diff --git a/testsuite/tests/driver/recomp017/C.hs b/testsuite/tests/driver/recomp017/C.hs
new file mode 100644
index 0000000..a6d1af0
--- /dev/null
+++ b/testsuite/tests/driver/recomp017/C.hs
@@ -0,0 +1,5 @@
+{-# LANGUAGE TypeFamilies #-}
+module C where
+import A
+data C
+type instance F (a,C) = ()
diff --git a/testsuite/tests/driver/recomp017/C2.hs b/testsuite/tests/driver/recomp017/C2.hs
new file mode 100644
index 0000000..551de2b
--- /dev/null
+++ b/testsuite/tests/driver/recomp017/C2.hs
@@ -0,0 +1,5 @@
+{-# LANGUAGE TypeFamilies #-}
+module C where
+import A
+data C
+type instance F (a,C) = Bool
diff --git a/testsuite/tests/driver/recomp017/D.hs b/testsuite/tests/driver/recomp017/D.hs
new file mode 100644
index 0000000..8ed80ad
--- /dev/null
+++ b/testsuite/tests/driver/recomp017/D.hs
@@ -0,0 +1,3 @@
+module D (b) where
+import B
+import C
diff --git a/testsuite/tests/driver/recomp017/E.hs b/testsuite/tests/driver/recomp017/E.hs
new file mode 100644
index 0000000..326a03d
--- /dev/null
+++ b/testsuite/tests/driver/recomp017/E.hs
@@ -0,0 +1,10 @@
+{-# LANGUAGE TypeApplications #-}
+module E where
+import A
+import B
+import C
+import D
+c :: F (a, C) -> Bool
+c = id
+e :: () -> Bool
+e = c . b @ C
diff --git a/testsuite/tests/driver/recomp017/Makefile b/testsuite/tests/driver/recomp017/Makefile
new file mode 100644
index 0000000..6a2f92a
--- /dev/null
+++ b/testsuite/tests/driver/recomp017/Makefile
@@ -0,0 +1,21 @@
+TOP=../../..
+include $(TOP)/mk/boilerplate.mk
+include $(TOP)/mk/test.mk
+
+# Recompilation tests
+
+clean:
+	rm -f *.o *.hi
+
+# bug #13099
+
+recomp017: clean
+	echo 'first run'
+	'$(TEST_HC)' $(TEST_HC_OPTS) --make D.hs
+	sleep 1
+	# A simple 'cp' would overwrite the original file,
+	# pointed to by the symlink
+	mv -f C2.hs C.hs
+	touch C.hs
+	echo 'second run'
+	! '$(TEST_HC)' $(TEST_HC_OPTS) --make E.hs
diff --git a/testsuite/tests/driver/recomp017/all.T b/testsuite/tests/driver/recomp017/all.T
new file mode 100644
index 0000000..1ba5343
--- /dev/null
+++ b/testsuite/tests/driver/recomp017/all.T
@@ -0,0 +1,11 @@
+# Test for #13099, a recompilation bug involving type family instances
+
+test('recomp017',
+     [ clean_cmd('$MAKE -s clean'),
+       extra_files(['A.hs', 'B.hs', 'C.hs', 'C2.hs',
+                    'D.hs', 'E.hs']),
+       ignore_stdout,
+       expect_broken(13099) ],
+     run_command,
+     ['$MAKE -s --no-print-directory recomp017'])
+



More information about the ghc-commits mailing list