summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Buhr <buhr@asaurus.net>2019-05-06 21:40:37 -0500
committerBen Gamari <ben@smart-cactus.org>2019-05-14 16:41:19 -0400
commit357be128fc1b545c182a9c6167437616636a300b (patch)
tree64c33f90ed1bee1482597699a1cb2111e8848ae7
parent4e25bf46fd722178d3a5ca65ccf2f13710f56a91 (diff)
downloadhaskell-357be128fc1b545c182a9c6167437616636a300b.tar.gz
Add regression test for old parser issue #504
-rw-r--r--testsuite/tests/parser/should_compile/T504.hs11
-rw-r--r--testsuite/tests/parser/should_compile/all.T1
2 files changed, 12 insertions, 0 deletions
diff --git a/testsuite/tests/parser/should_compile/T504.hs b/testsuite/tests/parser/should_compile/T504.hs
new file mode 100644
index 0000000000..bf315388df
--- /dev/null
+++ b/testsuite/tests/parser/should_compile/T504.hs
@@ -0,0 +1,11 @@
+{-# OPTIONS_GHC -Wno-inline-rule-shadowing #-}
+module Bug where
+
+-- regression test for #504:
+-- the pragma start and end sequences can both start in column 1
+-- without parse error
+
+{-# RULES
+ "foo" foo 1 = 1
+#-}
+foo 1 = 1
diff --git a/testsuite/tests/parser/should_compile/all.T b/testsuite/tests/parser/should_compile/all.T
index 4fdc359f13..fdb35c4d58 100644
--- a/testsuite/tests/parser/should_compile/all.T
+++ b/testsuite/tests/parser/should_compile/all.T
@@ -143,3 +143,4 @@ test('T15675', normal, compile, [''])
test('T15781', normal, compile, [''])
test('T16339', normal, compile, [''])
test('T16619', [], multimod_compile, ['T16619', '-v0'])
+test('T504', normal, compile, [''])