Hannes Siebenhandl pushed to branch wip/fendor/hpc-bc-support at Glasgow Haskell Compiler / GHC
Commits:
-
7f2d3236
by fendor at 2026-04-10T14:24:13+02:00
23 changed files:
- testsuite/tests/hpc/Makefile
- testsuite/tests/hpc/T17073.stdout → testsuite/tests/hpc/T17073a.stdout
- + testsuite/tests/hpc/T17073b.stdout
- testsuite/tests/hpc/T20568.stdout → testsuite/tests/hpc/T20568a.stdout
- + testsuite/tests/hpc/T20568b.stdout
- testsuite/tests/hpc/all.T
- testsuite/tests/hpc/fork/Makefile
- testsuite/tests/hpc/function/Makefile
- testsuite/tests/hpc/function/test.T
- + testsuite/tests/hpc/function/tough1.stderr
- + testsuite/tests/hpc/function/tough1.stdout
- testsuite/tests/hpc/function2/test.T
- + testsuite/tests/hpc/function2/tough3.script
- testsuite/tests/hpc/ghc_ghci/Makefile
- testsuite/tests/hpc/hpcrun.pl
- testsuite/tests/hpc/simple/Makefile
- + testsuite/tests/hpc/simple/hpc002.hs
- + testsuite/tests/hpc/simple/hpc002.stdout
- + testsuite/tests/hpc/simple/hpc003.hs
- + testsuite/tests/hpc/simple/hpc003.script
- + testsuite/tests/hpc/simple/hpc003.stderr
- + testsuite/tests/hpc/simple/hpc003.stdout
- testsuite/tests/hpc/simple/test.T
Changes:
| 1 | -TOP=../..
|
|
| 1 | +TOP=/home/hugin/Documents/haskell/ghc-hpc-bc/testsuite
|
|
| 2 | 2 | include $(TOP)/mk/boilerplate.mk
|
| 3 | 3 | include $(TOP)/mk/test.mk
|
| 4 | 4 | |
| ... | ... | @@ -8,13 +8,22 @@ T11798: |
| 8 | 8 | "$(TEST_HC)" $(TEST_HC_ARGS) T11798 -fhpc
|
| 9 | 9 | test -e .hpc/T11798.mix
|
| 10 | 10 | |
| 11 | -T17073:
|
|
| 11 | +T17073a:
|
|
| 12 | 12 | LANG=ASCII "$(TEST_HC)" $(TEST_HC_ARGS) T17073.hs -fhpc -v0
|
| 13 | 13 | ./T17073
|
| 14 | 14 | "$(HPC)" report T17073
|
| 15 | 15 | "$(HPC)" version
|
| 16 | 16 | LANG=ASCII "$(HPC)" markup T17073
|
| 17 | 17 | |
| 18 | -T20568:
|
|
| 18 | +T17073b:
|
|
| 19 | + HPCTIXFILE=ghc.tix "$(TEST_HC)" $(TEST_HC_OPTS_INTERACTIVE) $(TEST_HC_ARGS) T17073.hs -fhpc -v0 -e ":main"
|
|
| 20 | + "$(HPC)" report ghc
|
|
| 21 | + "$(HPC)" version
|
|
| 22 | + LANG=ASCII "$(HPC)" markup ghc
|
|
| 23 | + |
|
| 24 | +T20568a:
|
|
| 19 | 25 | "$(TEST_HC)" $(TEST_HC_ARGS) T20568.hs -fhpc -v0
|
| 20 | 26 | ./T20568
|
| 27 | + |
|
| 28 | +T20568b:
|
|
| 29 | + HPCTIXFILE=ghc.tix "$(TEST_HC)" $(TEST_HC_OPTS_INTERACTIVE) $(TEST_HC_ARGS) T20568.hs -fhpc -v0 -e ":main" |
| ... | ... | @@ -12,4 +12,4 @@ Writing: Main.hs.html |
| 12 | 12 | Writing: hpc_index.html
|
| 13 | 13 | Writing: hpc_index_fun.html
|
| 14 | 14 | Writing: hpc_index_alt.html
|
| 15 | -Writing: hpc_index_exp.html |
|
| \ No newline at end of file | ||
| 15 | +Writing: hpc_index_exp.html |
| 1 | +Добрый день
|
|
| 2 | +100% expressions used (2/2)
|
|
| 3 | +100% boolean coverage (0/0)
|
|
| 4 | + 100% guards (0/0)
|
|
| 5 | + 100% 'if' conditions (0/0)
|
|
| 6 | + 100% qualifiers (0/0)
|
|
| 7 | +100% alternatives used (0/0)
|
|
| 8 | +100% local declarations used (0/0)
|
|
| 9 | +100% top-level declarations used (1/1)
|
|
| 10 | +hpc tools, version 0.69
|
|
| 11 | +Writing: Main.hs.html
|
|
| 12 | +Writing: hpc_index.html
|
|
| 13 | +Writing: hpc_index_fun.html
|
|
| 14 | +Writing: hpc_index_alt.html
|
|
| 15 | +Writing: hpc_index_exp.html |
| 1 | +IfThenElse (AstBool True) (AstInt 1) (AstInt 2) |
| ... | ... | @@ -23,7 +23,10 @@ test('T2991', [cmd_wrapper(T2991)], |
| 23 | 23 | # Run with 'ghc --main'. Do not list other modules explicitly.
|
| 24 | 24 | multimod_compile_and_run, ['T2991', ''])
|
| 25 | 25 | |
| 26 | -test('T17073', when(opsys('mingw32'), expect_broken(17607)),
|
|
| 27 | - makefile_test, ['T17073 HPC={hpc}'])
|
|
| 26 | +test('T17073a', [when(opsys('mingw32'), expect_broken(17607)), extra_files(['T17073.hs'])],
|
|
| 27 | + makefile_test, ['T17073a HPC={hpc}'])
|
|
| 28 | +test('T17073b', [when(opsys('mingw32'), expect_broken(17607)), extra_files(['T17073.hs'])],
|
|
| 29 | + makefile_test, ['T17073b HPC={hpc}'])
|
|
| 28 | 30 | |
| 29 | -test('T20568', normal, makefile_test, []) |
|
| 31 | +test('T20568a', [extra_files(['T20568.hs'])], makefile_test, [])
|
|
| 32 | +test('T20568b', [extra_files(['T20568.hs'])], makefile_test, []) |
| 1 | 1 | TOP=../../..
|
| 2 | 2 | include $(TOP)/mk/boilerplate.mk
|
| 3 | 3 | include $(TOP)/mk/test.mk |
| 4 | - |
| ... | ... | @@ -2,3 +2,8 @@ TOP=../../.. |
| 2 | 2 | include $(TOP)/mk/boilerplate.mk
|
| 3 | 3 | include $(TOP)/mk/test.mk
|
| 4 | 4 | |
| 5 | +tough1:
|
|
| 6 | + HPCTIXFILE=ghc.tix "$(TEST_HC)" $(TEST_HC_OPTS_INTERACTICE) -v0 -fhpc tough.hs -e "main"
|
|
| 7 | + "$(HPC)" report ghc.tix
|
|
| 8 | + "$(HPC)" report ghc.tix --per-module
|
|
| 9 | + "$(HPC)" markup ghc.tix |
| 1 | -setTestOpts([omit_ghci, when(fast(), skip), js_skip])
|
|
| 1 | +setTestOpts([when(fast(), skip), js_skip])
|
|
| 2 | 2 | |
| 3 | 3 | hpc_prefix = "perl hpcrun.pl --clear --exeext={exeext} --hpc={hpc}"
|
| 4 | 4 | |
| ... | ... | @@ -8,3 +8,9 @@ test('tough', |
| 8 | 8 | ignore_extension,
|
| 9 | 9 | when(arch('wasm32'), fragile(23243))],
|
| 10 | 10 | compile_and_run, ['-fhpc'])
|
| 11 | + |
|
| 12 | +test('tough1',
|
|
| 13 | + [extra_files(['tough.hs']),
|
|
| 14 | + ignore_extension,
|
|
| 15 | + when(arch('wasm32'), fragile(23243))],
|
|
| 16 | + makefile_test, []) |
| 1 | +tough.hs:22:5: warning: [GHC-53633] [-Woverlapping-patterns]
|
|
| 2 | + Pattern match is redundant
|
|
| 3 | + In a case alternative: _ -> ...
|
|
| 4 | + |
|
|
| 5 | +22 | _ -> error "Bad Thing Happened"
|
|
| 6 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
| 7 | + |
| 1 | +"Hello"
|
|
| 2 | +"Hello"
|
|
| 3 | +badCase
|
|
| 4 | +badCase
|
|
| 5 | +"Bark"
|
|
| 6 | +"Hello"
|
|
| 7 | +(1,2,3)
|
|
| 8 | + 73% expressions used (73/100)
|
|
| 9 | + 14% boolean coverage (1/7)
|
|
| 10 | + 0% guards (0/4), 3 always True, 1 always False
|
|
| 11 | + 33% 'if' conditions (1/3), 1 always True, 1 always False
|
|
| 12 | + 100% qualifiers (0/0)
|
|
| 13 | + 58% alternatives used (7/12)
|
|
| 14 | +100% local declarations used (0/0)
|
|
| 15 | + 83% top-level declarations used (5/6)
|
|
| 16 | +-----<module Main>-----
|
|
| 17 | + 73% expressions used (73/100)
|
|
| 18 | + 14% boolean coverage (1/7)
|
|
| 19 | + 0% guards (0/4), 3 always True, 1 always False
|
|
| 20 | + 33% 'if' conditions (1/3), 1 always True, 1 always False
|
|
| 21 | + 100% qualifiers (0/0)
|
|
| 22 | + 58% alternatives used (7/12)
|
|
| 23 | +100% local declarations used (0/0)
|
|
| 24 | + 83% top-level declarations used (5/6)
|
|
| 25 | +Writing: Main.hs.html
|
|
| 26 | +Writing: hpc_index.html
|
|
| 27 | +Writing: hpc_index_fun.html
|
|
| 28 | +Writing: hpc_index_alt.html
|
|
| 29 | +Writing: hpc_index_exp.html |
| ... | ... | @@ -14,3 +14,14 @@ test('tough2', |
| 14 | 14 | omit_ways(ghci_ways + prof_ways), # profile goes in the wrong place
|
| 15 | 15 | when(arch('wasm32'), fragile(23243)) ],
|
| 16 | 16 | multimod_compile_and_run, ['subdir/tough2.lhs', '-fhpc'])
|
| 17 | + |
|
| 18 | +# Same as tough2, but for ghci
|
|
| 19 | +test('tough3',
|
|
| 20 | + [extra_files(['../hpcrun.pl', 'subdir/']),
|
|
| 21 | + literate,
|
|
| 22 | + cmd_prefix(hpc_prefix),
|
|
| 23 | + ignore_extension,
|
|
| 24 | + extra_hc_opts('-fhpc subdir/tough2.lhs'),
|
|
| 25 | + omit_ways(ghci_ways + prof_ways), # profile goes in the wrong place
|
|
| 26 | + when(arch('wasm32'), fragile(23243)) ],
|
|
| 27 | + ghci_script, ['tough3.script']) |
| 1 | +:main
|
|
| 2 | +:quit |
| ... | ... | @@ -9,7 +9,7 @@ hpc_ghc_ghci: |
| 9 | 9 | |
| 10 | 10 | hpc_ghc_ghci_bytecode:
|
| 11 | 11 | rm -f ./*.tix
|
| 12 | - printf "main\n:quit\n" | '$(TEST_HC)' $(TEST_HC_OPTS_INTERACTIVE) -fhpc -fbyte-code-and-object-code -fprefer-byte-code BytecodeMain.hs
|
|
| 12 | + '$(TEST_HC)' $(TEST_HC_OPTS_INTERACTIVE) -fhpc -fbyte-code-and-object-code -fprefer-byte-code BytecodeMain.hs -e "main" -e ":quit"
|
|
| 13 | 13 | @[ -f .hpc/Main.mix ] || (echo "ERROR: Expected .hpc/Main.mix file not found"; exit 1)
|
| 14 | 14 | @set -- ./*.tix; [ -f "$$1" ] || (echo "ERROR: Expected .tix file not found"; exit 1); '$(HPC)' report "$$1" Main > hpc-report.txt
|
| 15 | 15 | @grep -F "100% expressions used" hpc-report.txt >/dev/null || (echo "ERROR: Expected full expression coverage in hpc report"; cat hpc-report.txt; exit 1) |
| ... | ... | @@ -4,11 +4,12 @@ |
| 4 | 4 | |
| 5 | 5 | while($ARGV[0] =~ /^--/) {
|
| 6 | 6 | $arg = shift @ARGV;
|
| 7 | + last if ($arg eq '--');
|
|
| 7 | 8 | if ($arg =~ /--hpc=(.*)/) {
|
| 8 | 9 | $HPC = $1;
|
| 9 | - }
|
|
| 10 | + }
|
|
| 10 | 11 | elsif ($arg =~ /--clear/) {
|
| 11 | - $CLEAR = 1;
|
|
| 12 | + $CLEAR = 1;
|
|
| 12 | 13 | }
|
| 13 | 14 | elsif ($arg =~ /--exeext=(.*)/) {
|
| 14 | 15 | $exeext = $1;
|
| ... | ... | @@ -19,8 +20,10 @@ while($ARGV[0] =~ /^--/) { |
| 19 | 20 | }
|
| 20 | 21 | |
| 21 | 22 | die "no option --hpc=* provided\n" if (!defined($HPC));
|
| 22 | -
|
|
| 23 | -$binary = $ARGV[0] . $exeext;
|
|
| 23 | + |
|
| 24 | +# Skip over any KEY=VALUE env assignments to find the real executable
|
|
| 25 | +my $exe = (grep { !/^\w+=/ } @ARGV)[0];
|
|
| 26 | +$binary = $exe . $exeext;
|
|
| 24 | 27 | |
| 25 | 28 | # get the basename: needed for the test function/subdir/tough2
|
| 26 | 29 | $binary =~ s/^.*\/([^\/]*)$/$1/;
|
| ... | ... | @@ -38,7 +41,7 @@ while(<MARKUP>) { |
| 38 | 41 | my $line = $_;
|
| 39 | 42 | print $line;
|
| 40 | 43 | if (/Writing: (\S+.html)/) {
|
| 41 | - system("cat $1");
|
|
| 44 | + system("cat $1");
|
|
| 42 | 45 | }
|
| 43 | 46 | }
|
| 44 | 47 | print "\n\n"; |
| ... | ... | @@ -2,3 +2,12 @@ TOP=../../.. |
| 2 | 2 | include $(TOP)/mk/boilerplate.mk
|
| 3 | 3 | include $(TOP)/mk/test.mk
|
| 4 | 4 | |
| 5 | +hpc002:
|
|
| 6 | + HPCTIXFILE=ghc.tix "$(TEST_HC)" $(TEST_HC_OPTS_INTERACTIVE) $(TEST_HC_ARGS) hpc002.hs -fhpc -v0 -e ":main"
|
|
| 7 | + "$(HPC)" report ghc
|
|
| 8 | + "$(HPC)" report ghc --per-module
|
|
| 9 | + LANG=ASCII "$(HPC)" markup ghc
|
|
| 10 | + |
|
| 11 | +hpc003:
|
|
| 12 | + HPCTIXFILE=ghc.tix "$(TEST_HC)" $(TEST_HC_OPTS_INTERACTIVE) $(TEST_HC_ARGS) -fhpc -v0 < hpc003.script
|
|
| 13 | + "$(HPC)" report ghc || echo "Can't summarise file that is ':load'ed" |
| 1 | +main = print (const "Hello" "World") |
| 1 | +"Hello"
|
|
| 2 | + 75% expressions used (3/4)
|
|
| 3 | +100% boolean coverage (0/0)
|
|
| 4 | + 100% guards (0/0)
|
|
| 5 | + 100% 'if' conditions (0/0)
|
|
| 6 | + 100% qualifiers (0/0)
|
|
| 7 | +100% alternatives used (0/0)
|
|
| 8 | +100% local declarations used (0/0)
|
|
| 9 | +100% top-level declarations used (1/1)
|
|
| 10 | +-----<module Main>-----
|
|
| 11 | + 75% expressions used (3/4)
|
|
| 12 | +100% boolean coverage (0/0)
|
|
| 13 | + 100% guards (0/0)
|
|
| 14 | + 100% 'if' conditions (0/0)
|
|
| 15 | + 100% qualifiers (0/0)
|
|
| 16 | +100% alternatives used (0/0)
|
|
| 17 | +100% local declarations used (0/0)
|
|
| 18 | +100% top-level declarations used (1/1)
|
|
| 19 | +Writing: Main.hs.html
|
|
| 20 | +Writing: hpc_index.html
|
|
| 21 | +Writing: hpc_index_fun.html
|
|
| 22 | +Writing: hpc_index_alt.html
|
|
| 23 | +Writing: hpc_index_exp.html |
| 1 | +main = print (const "Hello" "World") |
| 1 | +:load hpc003.hs
|
|
| 2 | +:main |
| 1 | +hpc: Uncaught exception ghc-internal:GHC.Internal.Exception.ErrorCall:
|
|
| 2 | + |
|
| 3 | +can not find interactivezmsession_Main in ./.hpc
|
|
| 4 | + |
|
| 5 | +HasCallStack backtrace:
|
|
| 6 | + error, called at libraries/hpc/Trace/Hpc/Mix.hs:110:15 in hpc-0.7.0.2-inplace:Trace.Hpc.Mix
|
|
| 7 | + |
| 1 | +"Hello"
|
|
| 2 | +Can't summarise file that is ':load'ed |
| 1 | -setTestOpts([omit_ghci, when(fast(), skip), js_skip])
|
|
| 1 | +setTestOpts([when(fast(), skip), js_skip])
|
|
| 2 | 2 | |
| 3 | 3 | hpc_prefix = "perl hpcrun.pl --clear --exeext={exeext} --hpc={hpc}"
|
| 4 | 4 | |
| ... | ... | @@ -7,3 +7,16 @@ test('hpc001', [extra_files(['../hpcrun.pl']), cmd_prefix(hpc_prefix), |
| 7 | 7 | ignore_extension
|
| 8 | 8 | ],
|
| 9 | 9 | compile_and_run, ['-fhpc'])
|
| 10 | + |
|
| 11 | +test('hpc002',
|
|
| 12 | + [ when(arch('wasm32'), fragile(23243))
|
|
| 13 | + , ignore_extension
|
|
| 14 | + ],
|
|
| 15 | + makefile_test, [])
|
|
| 16 | + |
|
| 17 | +test('hpc003',
|
|
| 18 | + [ when(arch('wasm32'), fragile(23243))
|
|
| 19 | + , ignore_extension
|
|
| 20 | + , extra_files(['hpc003.script'])
|
|
| 21 | + ],
|
|
| 22 | + makefile_test, []) |