summaryrefslogtreecommitdiff
path: root/testsuite/tests/driver/T8144
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/driver/T8144')
-rw-r--r--testsuite/tests/driver/T8144/Makefile20
-rw-r--r--testsuite/tests/driver/T8144/T8144.stdout1
-rw-r--r--testsuite/tests/driver/T8144/Test.hs3
-rw-r--r--testsuite/tests/driver/T8144/cabal_macros.h1
-rw-r--r--testsuite/tests/driver/T8144/test.T1
5 files changed, 26 insertions, 0 deletions
diff --git a/testsuite/tests/driver/T8144/Makefile b/testsuite/tests/driver/T8144/Makefile
new file mode 100644
index 0000000000..f5df0dc22e
--- /dev/null
+++ b/testsuite/tests/driver/T8144/Makefile
@@ -0,0 +1,20 @@
+TOP=../../..
+include $(TOP)/mk/boilerplate.mk
+include $(TOP)/mk/test.mk
+
+# Test that iface hashes are reproducible, and in particular don't include
+# timestamps of dependent files. This test case was originally written by Niklas
+# Hambüchen; see
+# https://github.com/nh2/ghc-bug-time-dependent-interface-hashes/
+#
+clean ::
+ rm -f *.o *.hi *.show-iface
+
+dotest ::
+ '$(TEST_HC)' $(TEST_HC_OPTS) -c Test.hs -optP-include -optPcabal_macros.h
+ '$(TEST_HC)' $(TEST_HC_OPTS) --show-iface Test.hi > before.show-iface
+ sleep 1 # because some systems have a 1-second resolution for file timestamps
+ touch cabal_macros.h
+ '$(TEST_HC)' $(TEST_HC_OPTS) -c Test.hs -optP-include -optPcabal_macros.h
+ '$(TEST_HC)' $(TEST_HC_OPTS) --show-iface Test.hi > after.show-iface
+ diff before.show-iface after.show-iface
diff --git a/testsuite/tests/driver/T8144/T8144.stdout b/testsuite/tests/driver/T8144/T8144.stdout
new file mode 100644
index 0000000000..ae02c1f7a8
--- /dev/null
+++ b/testsuite/tests/driver/T8144/T8144.stdout
@@ -0,0 +1 @@
+compilation IS NOT required
diff --git a/testsuite/tests/driver/T8144/Test.hs b/testsuite/tests/driver/T8144/Test.hs
new file mode 100644
index 0000000000..5c8df5383c
--- /dev/null
+++ b/testsuite/tests/driver/T8144/Test.hs
@@ -0,0 +1,3 @@
+{-# LANGUAGE CPP #-}
+
+module Test () where
diff --git a/testsuite/tests/driver/T8144/cabal_macros.h b/testsuite/tests/driver/T8144/cabal_macros.h
new file mode 100644
index 0000000000..445e735c91
--- /dev/null
+++ b/testsuite/tests/driver/T8144/cabal_macros.h
@@ -0,0 +1 @@
+/* This comment is here to please the whitespace linter */
diff --git a/testsuite/tests/driver/T8144/test.T b/testsuite/tests/driver/T8144/test.T
new file mode 100644
index 0000000000..0712d0cffc
--- /dev/null
+++ b/testsuite/tests/driver/T8144/test.T
@@ -0,0 +1 @@
+test('T8144', [extra_files(['Test.hs', 'cabal_macros.h'])], makefile_test, ['dotest'])