summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorPepe Iborra <pepeiborra@gmail.com>2021-05-17 13:26:28 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-05-26 16:03:52 -0400
commit9faafb0aaff04e86a58b9e108f84618b12f2057c (patch)
tree653bf689feab7942bcfe49dab420a6c6f1fc3280 /testsuite
parentcdbce8fc22448837e53515946f16e9571e06f412 (diff)
downloadhaskell-9faafb0aaff04e86a58b9e108f84618b12f2057c.tar.gz
Avoid fingerprinting the absolute path to the source file
This change aims to make source files relocatable w.r.t. to the interface files produced by the compiler. This is so that we can download interface files produced by a cloud build system and then reuse them in a local ghcide session catch another case of implicit includes actually use the implicit quote includes add another missing case recomp020 test that .hi files are reused even if .hs files are moved to a new location Added recomp021 to record behaviour with non implicit includes add a note additional pointer to the note Mention #16956 in Note
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/tests/driver/recomp020/A.hs4
-rw-r--r--testsuite/tests/driver/recomp020/Makefile15
-rw-r--r--testsuite/tests/driver/recomp020/all.T4
-rw-r--r--testsuite/tests/driver/recomp021/A.hs6
-rw-r--r--testsuite/tests/driver/recomp021/B.hs1
-rw-r--r--testsuite/tests/driver/recomp021/Makefile16
-rw-r--r--testsuite/tests/driver/recomp021/all.T4
-rw-r--r--testsuite/tests/driver/recomp021/recomp021.stdout1
8 files changed, 51 insertions, 0 deletions
diff --git a/testsuite/tests/driver/recomp020/A.hs b/testsuite/tests/driver/recomp020/A.hs
new file mode 100644
index 0000000000..900eaa3929
--- /dev/null
+++ b/testsuite/tests/driver/recomp020/A.hs
@@ -0,0 +1,4 @@
+module A where
+
+a :: ()
+a = ()
diff --git a/testsuite/tests/driver/recomp020/Makefile b/testsuite/tests/driver/recomp020/Makefile
new file mode 100644
index 0000000000..9e66837d24
--- /dev/null
+++ b/testsuite/tests/driver/recomp020/Makefile
@@ -0,0 +1,15 @@
+TOP=../../..
+include $(TOP)/mk/boilerplate.mk
+include $(TOP)/mk/test.mk
+
+# Recompilation test for when .hi files are up to date but .hs files have been moved
+
+
+recomp020:
+ mkdir src1
+ mkdir src2
+ cp A.hs src1/A.hs
+ cp A.hs src2/A.hs
+ '$(TEST_HC)' $(TEST_HC_OPTS) -S src1/A.hs
+ '$(TEST_HC)' $(TEST_HC_OPTS) -S src2/A.hs
+ diff src1/A.hi src2/A.hi
diff --git a/testsuite/tests/driver/recomp020/all.T b/testsuite/tests/driver/recomp020/all.T
new file mode 100644
index 0000000000..5085d130bd
--- /dev/null
+++ b/testsuite/tests/driver/recomp020/all.T
@@ -0,0 +1,4 @@
+# Recompilation test for when .hi files are up to date but .o files are
+# not
+
+test('recomp020', [extra_files(['A.hs'])], makefile_test, [])
diff --git a/testsuite/tests/driver/recomp021/A.hs b/testsuite/tests/driver/recomp021/A.hs
new file mode 100644
index 0000000000..3851590cf0
--- /dev/null
+++ b/testsuite/tests/driver/recomp021/A.hs
@@ -0,0 +1,6 @@
+{-# LANGUAGE CPP #-}
+
+module A(foo) where
+
+
+#include "B.hs"
diff --git a/testsuite/tests/driver/recomp021/B.hs b/testsuite/tests/driver/recomp021/B.hs
new file mode 100644
index 0000000000..c0c7d42f6c
--- /dev/null
+++ b/testsuite/tests/driver/recomp021/B.hs
@@ -0,0 +1 @@
+foo = ()
diff --git a/testsuite/tests/driver/recomp021/Makefile b/testsuite/tests/driver/recomp021/Makefile
new file mode 100644
index 0000000000..8a8cdcf21c
--- /dev/null
+++ b/testsuite/tests/driver/recomp021/Makefile
@@ -0,0 +1,16 @@
+TOP=../../..
+include $(TOP)/mk/boilerplate.mk
+include $(TOP)/mk/test.mk
+
+# Recompilation test for .hs files with CPP includes
+
+clean:
+
+recomp021: clean
+ mkdir src1
+ mkdir src2
+ cp *.hs src1
+ cp *.hs src2
+ '$(TEST_HC)' $(TEST_HC_OPTS) -S src1/A.hs
+ '$(TEST_HC)' $(TEST_HC_OPTS) -S src2/A.hs
+ ! diff src1/A.hi src2/A.hi
diff --git a/testsuite/tests/driver/recomp021/all.T b/testsuite/tests/driver/recomp021/all.T
new file mode 100644
index 0000000000..a2511ed6f7
--- /dev/null
+++ b/testsuite/tests/driver/recomp021/all.T
@@ -0,0 +1,4 @@
+# Recompilation test for when .hi files are up to date but .o files are
+# not
+
+test('recomp021', [extra_files(['A.hs', 'B.hs'])], makefile_test, [])
diff --git a/testsuite/tests/driver/recomp021/recomp021.stdout b/testsuite/tests/driver/recomp021/recomp021.stdout
new file mode 100644
index 0000000000..670403817b
--- /dev/null
+++ b/testsuite/tests/driver/recomp021/recomp021.stdout
@@ -0,0 +1 @@
+Binary files src1/A.hi and src2/A.hi differ