summaryrefslogtreecommitdiff
path: root/testsuite/tests/runghc
diff options
context:
space:
mode:
authorThomas Miedema <thomasmiedema@gmail.com>2016-02-20 23:07:50 +0100
committerThomas Miedema <thomasmiedema@gmail.com>2016-02-20 23:22:02 +0100
commit0b00add03043804211f567a3d0810114c0274252 (patch)
tree0e61ba34563c3eb1721656744c070a51f272b847 /testsuite/tests/runghc
parent9634e24519981c32b9c2a6570898b87aa9111405 (diff)
downloadhaskell-0b00add03043804211f567a3d0810114c0274252.tar.gz
Add test for #6132: hash bang + CPP
Diffstat (limited to 'testsuite/tests/runghc')
-rw-r--r--testsuite/tests/runghc/T6132.hs15
-rw-r--r--testsuite/tests/runghc/all.T2
2 files changed, 17 insertions, 0 deletions
diff --git a/testsuite/tests/runghc/T6132.hs b/testsuite/tests/runghc/T6132.hs
new file mode 100644
index 0000000000..dbb996b141
--- /dev/null
+++ b/testsuite/tests/runghc/T6132.hs
@@ -0,0 +1,15 @@
+#!/usr/bin/env whatever
+
+{-# LANGUAGE CPP #-}
+
+module Main where
+
+-- Compiling a program with CPP that also has a hash bang should work (#6132).
+-- Before ghc-7.8, it failed with:
+--
+-- error: invalid preprocessing directive #!
+-- #!/usr/bin/env runghc
+
+#if 1
+main = return ()
+#endif
diff --git a/testsuite/tests/runghc/all.T b/testsuite/tests/runghc/all.T
index 0403fbcf68..7c4fad251f 100644
--- a/testsuite/tests/runghc/all.T
+++ b/testsuite/tests/runghc/all.T
@@ -6,3 +6,5 @@ test('T8601', req_interp, run_command,
test('T11247', [req_interp, expect_broken(11247)], run_command,
['$MAKE --no-print-directory -s T11247'])
+
+test('T6132', [], compile, [''])