summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <bgamari.foss@gmail.com>2017-07-28 11:44:20 -0400
committerBen Gamari <ben@smart-cactus.org>2017-07-28 12:36:48 -0400
commit262bb95f5e00eea783d3e756fe86d96839be45d7 (patch)
treeaa1314297b726bfbe3ab948c245ec7ca0b98fbc7
parent54d3a1fdeb7044a1d9bb025d4880d08c708b4cd0 (diff)
downloadhaskell-262bb95f5e00eea783d3e756fe86d96839be45d7.tar.gz
testsuite: Add test for #14028
Reviewers: austin Subscribers: rwbarton, thomie GHC Trac Issues: #14028 Differential Revision: https://phabricator.haskell.org/D3788
-rw-r--r--testsuite/tests/quasiquotation/Makefile4
-rw-r--r--testsuite/tests/quasiquotation/T14028.hs8
-rw-r--r--testsuite/tests/quasiquotation/T14028C.c5
-rw-r--r--testsuite/tests/quasiquotation/T14028Quote.hs6
-rw-r--r--testsuite/tests/quasiquotation/all.T4
5 files changed, 27 insertions, 0 deletions
diff --git a/testsuite/tests/quasiquotation/Makefile b/testsuite/tests/quasiquotation/Makefile
index 8e2e7e7c78..ebc91d23e5 100644
--- a/testsuite/tests/quasiquotation/Makefile
+++ b/testsuite/tests/quasiquotation/Makefile
@@ -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
index 0000000000..5313df6e77
--- /dev/null
+++ b/testsuite/tests/quasiquotation/T14028.hs
@@ -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
index 0000000000..0115013d70
--- /dev/null
+++ b/testsuite/tests/quasiquotation/T14028C.c
@@ -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
index 0000000000..01413ec100
--- /dev/null
+++ b/testsuite/tests/quasiquotation/T14028Quote.hs
@@ -0,0 +1,6 @@
+module T14028Quote where
+import Language.Haskell.TH
+import Language.Haskell.TH.Quote
+
+here :: QuasiQuoter
+here = QuasiQuoter { quoteExp = litE . stringL }
diff --git a/testsuite/tests/quasiquotation/all.T b/testsuite/tests/quasiquotation/all.T
index 84d25f8bdd..a10b8e4446 100644
--- a/testsuite/tests/quasiquotation/all.T
+++ b/testsuite/tests/quasiquotation/all.T
@@ -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'])