summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2021-06-23 11:53:57 +0100
committerMatthew Pickering <matthewtpickering@gmail.com>2021-06-24 11:34:07 +0100
commit316dd7ea69e37d9a42d6b1f3c9d9f395e10a7b90 (patch)
tree0363cd90a0850dd17f4f86941ea1fa07f73b287c
parente7b874fc8e106b9e6e6457428052f5d13ee6f9e6 (diff)
downloadhaskell-wip/driver-tests.tar.gz
driver: Add test for T14923wip/driver-tests
-rw-r--r--testsuite/tests/driver/Makefile20
-rw-r--r--testsuite/tests/driver/T14923.stdout6
-rw-r--r--testsuite/tests/driver/all.T1
3 files changed, 27 insertions, 0 deletions
diff --git a/testsuite/tests/driver/Makefile b/testsuite/tests/driver/Makefile
index b097ab6c96..9f7716a4fe 100644
--- a/testsuite/tests/driver/Makefile
+++ b/testsuite/tests/driver/Makefile
@@ -706,3 +706,23 @@ T17481:
touch Main.hs
echo "Compiling and running Main.hs:"
"$(TEST_HC)" $(TEST_HC_OPTS) Main.hs && ./Main
+
+T14923:
+ echo "{-# LANGUAGE UndecidableInstances #-}" > Foo.hs
+ echo "module Foo where" >> Foo.hs
+
+ cat Foo.hs
+
+ "$(TEST_HC)" $(TEST_HC_OPTS) -c Foo.hs;
+
+ sed -i 's/^{-\#/--&/' Foo.hs # comment out the pragma
+
+ # Check sed actually worked
+ cat Foo.hs
+
+ # This should recompile
+ "$(TEST_HC)" $(TEST_HC_OPTS) -c Foo.hs;
+ # This should not
+ "$(TEST_HC)" $(TEST_HC_OPTS) -c Foo.hs;
+ # And this should not
+ "$(TEST_HC)" $(TEST_HC_OPTS) -c Foo.hs;
diff --git a/testsuite/tests/driver/T14923.stdout b/testsuite/tests/driver/T14923.stdout
new file mode 100644
index 0000000000..0303eb08ee
--- /dev/null
+++ b/testsuite/tests/driver/T14923.stdout
@@ -0,0 +1,6 @@
+{-# LANGUAGE UndecidableInstances #-}
+module Foo where
+--{-# LANGUAGE UndecidableInstances #-}
+module Foo where
+compilation IS NOT required
+compilation IS NOT required
diff --git a/testsuite/tests/driver/all.T b/testsuite/tests/driver/all.T
index 6fa78378ce..2afd735fe0 100644
--- a/testsuite/tests/driver/all.T
+++ b/testsuite/tests/driver/all.T
@@ -278,6 +278,7 @@ test('inline-check', omit_ways(['hpc', 'profasm'])
, ['-dinline-check foo -O -ddebug-output'])
test('T14452', [], makefile_test, [])
+test('T14923', normal, makefile_test, [])
test('T15396', normal, compile_and_run, ['-package ghc'])
test('T16737',
[extra_files(['T16737include/']),