summaryrefslogtreecommitdiff
path: root/testsuite/tests/stage1
diff options
context:
space:
mode:
authorThomas Miedema <thomasmiedema@gmail.com>2016-06-16 19:45:57 +0200
committerThomas Miedema <thomasmiedema@gmail.com>2016-06-18 12:51:59 +0200
commitd94c40561dde695e658169a3098642294f55c7e3 (patch)
tree94af58265a3f47bc6c949568661abe6f187b1aee /testsuite/tests/stage1
parent6f6f515401a29d26eaa5daae308b8e700abd4c04 (diff)
downloadhaskell-d94c40561dde695e658169a3098642294f55c7e3.tar.gz
Testsuite: validate the tests/stage1 directory with the stage1 compiler
* See `Note [Why is there no stage1 setup function?]`. * Move T2632 to the tests/stage1 directory (#10382). Reviewed by: ezyang, nomeata, bgamari Differential Revision: https://phabricator.haskell.org/D2341 GHC Trac Issues: #12197
Diffstat (limited to 'testsuite/tests/stage1')
-rw-r--r--testsuite/tests/stage1/Makefile6
-rw-r--r--testsuite/tests/stage1/T2632.hs14
-rw-r--r--testsuite/tests/stage1/all.T6
3 files changed, 26 insertions, 0 deletions
diff --git a/testsuite/tests/stage1/Makefile b/testsuite/tests/stage1/Makefile
new file mode 100644
index 0000000000..0916e4b1db
--- /dev/null
+++ b/testsuite/tests/stage1/Makefile
@@ -0,0 +1,6 @@
+TOP=../..
+
+stage = 1
+
+include $(TOP)/mk/boilerplate.mk
+include $(TOP)/mk/test.mk
diff --git a/testsuite/tests/stage1/T2632.hs b/testsuite/tests/stage1/T2632.hs
new file mode 100644
index 0000000000..71f6350cc2
--- /dev/null
+++ b/testsuite/tests/stage1/T2632.hs
@@ -0,0 +1,14 @@
+-- Trac #2632
+
+module MkData where
+
+import Language.Haskell.TH
+
+op :: Num v => v -> v -> v
+op a b = a + b
+
+decl1 = [d| func = 0 `op` 3 |]
+
+decl2 = [d| op x y = x
+ func = 0 `op` 3 |]
+
diff --git a/testsuite/tests/stage1/all.T b/testsuite/tests/stage1/all.T
new file mode 100644
index 0000000000..a7f01b3525
--- /dev/null
+++ b/testsuite/tests/stage1/all.T
@@ -0,0 +1,6 @@
+
+setTestOpts(unless(config.stage == 1, skip))
+
+# Test with stage1 compiler, see ticket:10382#comment:20.
+test('T2632', normal, compile,
+ ['-XTemplateHaskellQuotes -package template-haskell'])