testsuite: Add test for #14028
authorBen Gamari <bgamari.foss@gmail.com>
Fri, 28 Jul 2017 15:44:20 +0000 (11:44 -0400)
committerBen Gamari <ben@smart-cactus.org>
Fri, 28 Jul 2017 16:36:48 +0000 (12:36 -0400)
Reviewers: austin

Subscribers: rwbarton, thomie

GHC Trac Issues: #14028

Differential Revision: https://phabricator.haskell.org/D3788

testsuite/tests/quasiquotation/Makefile
testsuite/tests/quasiquotation/T14028.hs [new file with mode: 0644]
testsuite/tests/quasiquotation/T14028C.c [new file with mode: 0644]
testsuite/tests/quasiquotation/T14028Quote.hs [new file with mode: 0644]
testsuite/tests/quasiquotation/all.T

index 8e2e7e7..ebc91d2 100644 (file)
@@ -9,3 +9,7 @@ T4150:
        '$(TEST_HC)' $(TEST_HC_OPTS) -v0 -c T4150A.hs
        -'$(TEST_HC)' $(TEST_HC_OPTS) -v0 -c T4150.hs
 
+T14028:
+       '$(TEST_HC)' $(TEST_HC_OPTS) T14028Quote.hs
+       '$(TEST_HC)' $(TEST_HC_OPTS) -c T14028C.c
+       '$(TEST_HC)' $(TEST_HC_OPTS) -fexternal-interpreter T14028 T14028C.o
diff --git a/testsuite/tests/quasiquotation/T14028.hs b/testsuite/tests/quasiquotation/T14028.hs
new file mode 100644 (file)
index 0000000..5313df6
--- /dev/null
@@ -0,0 +1,8 @@
+{-# LANGUAGE QuasiQuotes #-}
+
+import T14028Quote
+
+s :: String
+s = [here|goes nothing|]
+
+main = putStrLn s
diff --git a/testsuite/tests/quasiquotation/T14028C.c b/testsuite/tests/quasiquotation/T14028C.c
new file mode 100644 (file)
index 0000000..0115013
--- /dev/null
@@ -0,0 +1,5 @@
+#include <stdio.h>
+
+void hi() {
+  puts("Hello, World!");
+}
diff --git a/testsuite/tests/quasiquotation/T14028Quote.hs b/testsuite/tests/quasiquotation/T14028Quote.hs
new file mode 100644 (file)
index 0000000..01413ec
--- /dev/null
@@ -0,0 +1,6 @@
+module T14028Quote where
+import Language.Haskell.TH
+import Language.Haskell.TH.Quote
+
+here :: QuasiQuoter
+here = QuasiQuoter { quoteExp  = litE . stringL }
index 84d25f8..a10b8e4 100644 (file)
@@ -6,3 +6,7 @@ test('T7918',
      [req_interp, extra_run_opts('"' + config.libdir + '"'),
       only_ways(config.ghc_th_way), unless(have_dynamic(), skip)],
      compile_and_run, ['-package ghc ' + config.ghc_th_way_flags])
+test('T14028',
+     [req_interp, only_ways(config.ghc_th_way)],
+     run_command,
+     ['$MAKE -s --no-print-directory T14028'])