summaryrefslogtreecommitdiff
path: root/testsuite/tests/parser/should_compile
diff options
context:
space:
mode:
authorVladislav Zavialov <vlad.z.4096@gmail.com>2019-11-12 10:56:57 +0300
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-12-05 16:07:44 -0500
commit84585e5e7c5d729ce38fa47ebaa7518acd14c2f1 (patch)
tree0420df471d093d543c6eaa05946f8da51758dd4b /testsuite/tests/parser/should_compile
parentf03a41d4bf9418ee028ecb51654c928b2da74edd (diff)
downloadhaskell-84585e5e7c5d729ce38fa47ebaa7518acd14c2f1.tar.gz
Meaning-preserving SCC annotations (#15730)
This patch implements GHC Proposal #176: https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0176-scc-parsing.rst Before the change: 1 / 2 / 2 = 0.25 1 / {-# SCC "name" #-} 2 / 2 = 1.0 After the change: 1 / 2 / 2 = 0.25 1 / {-# SCC "name" #-} 2 / 2 = parse error
Diffstat (limited to 'testsuite/tests/parser/should_compile')
-rw-r--r--testsuite/tests/parser/should_compile/T15730a.hs5
-rw-r--r--testsuite/tests/parser/should_compile/T15730a.stdout1
-rw-r--r--testsuite/tests/parser/should_compile/all.T2
3 files changed, 8 insertions, 0 deletions
diff --git a/testsuite/tests/parser/should_compile/T15730a.hs b/testsuite/tests/parser/should_compile/T15730a.hs
new file mode 100644
index 0000000000..5f1c45828a
--- /dev/null
+++ b/testsuite/tests/parser/should_compile/T15730a.hs
@@ -0,0 +1,5 @@
+x = 1 / 2 / 2
+a = {-# SCC ann #-} 1 / 2 / 2
+b = 1 / 2 / {-# SCC ann #-} 2
+
+main = print (x, a == x, b == x)
diff --git a/testsuite/tests/parser/should_compile/T15730a.stdout b/testsuite/tests/parser/should_compile/T15730a.stdout
new file mode 100644
index 0000000000..f8528ac72a
--- /dev/null
+++ b/testsuite/tests/parser/should_compile/T15730a.stdout
@@ -0,0 +1 @@
+(0.25,True,True)
diff --git a/testsuite/tests/parser/should_compile/all.T b/testsuite/tests/parser/should_compile/all.T
index 91aae139ab..85a7c3c172 100644
--- a/testsuite/tests/parser/should_compile/all.T
+++ b/testsuite/tests/parser/should_compile/all.T
@@ -162,3 +162,5 @@ test('proposal-229f',
omit_ways(['profasm', 'profthreaded'])
],
multimod_compile_and_run, ['proposal-229f.hs', ''])
+
+test('T15730a', normal, compile_and_run, [''])