Add test for #6132: hash bang + CPP
authorThomas Miedema <thomasmiedema@gmail.com>
Sat, 20 Feb 2016 22:07:50 +0000 (23:07 +0100)
committerThomas Miedema <thomasmiedema@gmail.com>
Sat, 20 Feb 2016 22:22:02 +0000 (23:22 +0100)
testsuite/tests/runghc/T6132.hs [new file with mode: 0644]
testsuite/tests/runghc/all.T

diff --git a/testsuite/tests/runghc/T6132.hs b/testsuite/tests/runghc/T6132.hs
new file mode 100644 (file)
index 0000000..dbb996b
--- /dev/null
@@ -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
index 0403fbc..7c4fad2 100644 (file)
@@ -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, [''])