summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorPhuong Trinh <lolotp@fb.com>2019-05-08 17:59:14 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-07-09 22:55:41 -0400
commitb05c8423bd97547e7961d947df27b34f52f2ce47 (patch)
tree36fa1d7242ea848676c703d15e16dfae23c5816b /testsuite
parent6a03d77b9a9915e4b37fe1ea6688c135e7b00654 (diff)
downloadhaskell-b05c8423bd97547e7961d947df27b34f52f2ce47.tar.gz
Fix #16511: changes in interface dependencies should trigger recompilation
If the union of dependencies of imported modules change, the `mi_deps` field of the interface files should change as well. Because of that, we need to check for changes in this in recompilation checker which we are not doing right now. This adds a checks for that.
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/tests/driver/T16511/A.hs8
-rw-r--r--testsuite/tests/driver/T16511/B1.hs4
-rw-r--r--testsuite/tests/driver/T16511/B2.hs3
-rw-r--r--testsuite/tests/driver/T16511/C.hs4
-rw-r--r--testsuite/tests/driver/T16511/D.hs6
-rw-r--r--testsuite/tests/driver/T16511/T16511.script12
-rw-r--r--testsuite/tests/driver/T16511/T16511.stdout6
-rw-r--r--testsuite/tests/driver/T16511/all.T2
8 files changed, 45 insertions, 0 deletions
diff --git a/testsuite/tests/driver/T16511/A.hs b/testsuite/tests/driver/T16511/A.hs
new file mode 100644
index 0000000000..4d3f7a3742
--- /dev/null
+++ b/testsuite/tests/driver/T16511/A.hs
@@ -0,0 +1,8 @@
+module A (mainA) where
+
+import B
+
+mainA :: IO ()
+mainA = do
+ putStrLn "Hello"
+ putStrLn name
diff --git a/testsuite/tests/driver/T16511/B1.hs b/testsuite/tests/driver/T16511/B1.hs
new file mode 100644
index 0000000000..f290969805
--- /dev/null
+++ b/testsuite/tests/driver/T16511/B1.hs
@@ -0,0 +1,4 @@
+module B (name) where
+
+name :: String
+name = "Samantha"
diff --git a/testsuite/tests/driver/T16511/B2.hs b/testsuite/tests/driver/T16511/B2.hs
new file mode 100644
index 0000000000..43f012c5db
--- /dev/null
+++ b/testsuite/tests/driver/T16511/B2.hs
@@ -0,0 +1,3 @@
+module B (C.name) where
+
+import qualified C
diff --git a/testsuite/tests/driver/T16511/C.hs b/testsuite/tests/driver/T16511/C.hs
new file mode 100644
index 0000000000..34283b3701
--- /dev/null
+++ b/testsuite/tests/driver/T16511/C.hs
@@ -0,0 +1,4 @@
+module C where
+
+name :: String
+name = "Samantha"
diff --git a/testsuite/tests/driver/T16511/D.hs b/testsuite/tests/driver/T16511/D.hs
new file mode 100644
index 0000000000..46ca0ee009
--- /dev/null
+++ b/testsuite/tests/driver/T16511/D.hs
@@ -0,0 +1,6 @@
+module D where
+
+import A
+
+main :: IO ()
+main = mainA
diff --git a/testsuite/tests/driver/T16511/T16511.script b/testsuite/tests/driver/T16511/T16511.script
new file mode 100644
index 0000000000..f6a48e99e9
--- /dev/null
+++ b/testsuite/tests/driver/T16511/T16511.script
@@ -0,0 +1,12 @@
+:! rm B.hs 2> /dev/null
+:! rm *.o 2> /dev/null
+:! rm *.hi 2> /dev/null
+:! cp B1.hs B.hs
+:load D.hs
+main
+:! cp B2.hs B.hs
+:reload
+main
+:! cp B1.hs B.hs
+:reload
+main
diff --git a/testsuite/tests/driver/T16511/T16511.stdout b/testsuite/tests/driver/T16511/T16511.stdout
new file mode 100644
index 0000000000..c54cfe1f12
--- /dev/null
+++ b/testsuite/tests/driver/T16511/T16511.stdout
@@ -0,0 +1,6 @@
+Hello
+Samantha
+Hello
+Samantha
+Hello
+Samantha
diff --git a/testsuite/tests/driver/T16511/all.T b/testsuite/tests/driver/T16511/all.T
new file mode 100644
index 0000000000..52b1503d76
--- /dev/null
+++ b/testsuite/tests/driver/T16511/all.T
@@ -0,0 +1,2 @@
+test('T16511', [extra_files(['B1.hs', 'B2.hs', 'D.hs', 'A.hs', 'C.hs']), ],
+ ghci_script, ['T16511.script'])