diff options
-rw-r--r-- | testsuite/tests/driver/Makefile | 20 | ||||
-rw-r--r-- | testsuite/tests/driver/T14923.stdout | 6 | ||||
-rw-r--r-- | testsuite/tests/driver/all.T | 1 |
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/']), |