From 84585e5e7c5d729ce38fa47ebaa7518acd14c2f1 Mon Sep 17 00:00:00 2001 From: Vladislav Zavialov Date: Tue, 12 Nov 2019 10:56:57 +0300 Subject: 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 --- testsuite/tests/profiling/should_run/prof-doc-last.hs | 4 ++-- testsuite/tests/profiling/should_run/prof-doc-last.prof.sample | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'testsuite/tests/profiling') diff --git a/testsuite/tests/profiling/should_run/prof-doc-last.hs b/testsuite/tests/profiling/should_run/prof-doc-last.hs index f5073fddc2..d74997d04b 100644 --- a/testsuite/tests/profiling/should_run/prof-doc-last.hs +++ b/testsuite/tests/profiling/should_run/prof-doc-last.hs @@ -2,6 +2,6 @@ main :: IO () main = do let xs = [1..1000000] let ys = [1..2000000] print $ {-# SCC "last_xs" #-} last xs - print $ {-# SCC "last_init_xs" #-} last $ init xs + print $ {-# SCC "last_init_xs" #-} last (init xs) print $ {-# SCC "last_ys" #-} last ys - print $ {-# SCC "last_init_ys" #-}last $ init ys + print $ {-# SCC "last_init_ys" #-} last (init ys) diff --git a/testsuite/tests/profiling/should_run/prof-doc-last.prof.sample b/testsuite/tests/profiling/should_run/prof-doc-last.prof.sample index 371fad43d7..f67863df48 100644 --- a/testsuite/tests/profiling/should_run/prof-doc-last.prof.sample +++ b/testsuite/tests/profiling/should_run/prof-doc-last.prof.sample @@ -8,7 +8,7 @@ COST CENTRE MODULE SRC %time %alloc main.ys Main prof-doc-last.hs:3:15-31 39.7 37.5 -last_init_ys Main prof-doc-last.hs:7:45-58 23.1 29.2 +last_init_ys Main prof-doc-last.hs:7:46-59 23.1 29.2 main.xs Main prof-doc-last.hs:2:15-31 23.1 18.7 last_init_xs Main prof-doc-last.hs:5:46-59 11.6 14.6 last_xs Main prof-doc-last.hs:4:41-47 1.7 0.0 @@ -27,7 +27,7 @@ MAIN MAIN 46 CAF GHC.IO.Encoding.Iconv 65 0 0.0 0.0 0.0 0.0 main Main prof-doc-last.hs:(2,1)-(7,58) 93 0 0.0 0.0 100.0 100.0 last_init_xs Main prof-doc-last.hs:5:46-59 96 1 11.6 14.6 11.6 14.6 - last_init_ys Main prof-doc-last.hs:7:45-58 99 1 23.1 29.2 23.1 29.2 + last_init_ys Main prof-doc-last.hs:7:46-59 99 1 23.1 29.2 23.1 29.2 last_xs Main prof-doc-last.hs:4:41-47 94 1 1.7 0.0 1.7 0.0 last_ys Main prof-doc-last.hs:6:41-47 97 1 0.8 0.0 0.8 0.0 main.xs Main prof-doc-last.hs:2:15-31 95 1 23.1 18.7 23.1 18.7 -- cgit v1.2.1