[Git][ghc/ghc][wip/jeltsch/textual-bytecode-output] 2 commits: Escape the `#`-signs in the makefile
Wolfgang Jeltsch pushed to branch wip/jeltsch/textual-bytecode-output at Glasgow Haskell Compiler / GHC Commits: 021b832a by Wolfgang Jeltsch at 2026-08-03T16:20:17+03:00 Escape the `#`-signs in the makefile - - - - - 30184f3a by Wolfgang Jeltsch at 2026-08-03T16:33:11+03:00 Establish a separate shell script for normalization - - - - - 3 changed files: - testsuite/tests/show-bytecode/Makefile - testsuite/tests/show-bytecode/all.T - + testsuite/tests/show-bytecode/normalize Changes: ===================================== testsuite/tests/show-bytecode/Makefile ===================================== @@ -2,34 +2,17 @@ TOP=../.. include $(TOP)/mk/boilerplate.mk include $(TOP)/mk/test.mk -compile = '$(TEST_HC)' $(TEST_HC_OPTS) \ - -fbyte-code -fwrite-byte-code -no-link -show = '$(TEST_HC)' $(TEST_HC_OPTS) \ - --show-byte-code -stabilize = sed -E -e ' \ - s/_r[[:alnum:]]+/_@name_suffix@/g; \ - s/^( *hash: )[[:xdigit:]]+/\1@hash@/g; \ - s/^( *)[[:xdigit:]]+:/\1@hash@:/g; \ - s/word [[:digit:]]{2}[[:digit:]]*/word @large_word@/ \ - ' -universalize = sed -E -e ' \ - s/UInt[[:digit:]]+/UInt@word_size@/; \ - s/W[[:digit:]]+#/W@word_size@#/ \ - ' | \ - uniq -normalize = $(stabilize) | $(universalize) -# The invocation of `uniq` in `$(universalize)` is merely for collapsing -# adjacent entries of `word @large_word@`, whose number may depend on the word -# size. +compile = '$(TEST_HC)' $(TEST_HC_OPTS) -fbyte-code -fwrite-byte-code -no-link +show = '$(TEST_HC)' $(TEST_HC_OPTS) --show-byte-code show-bytecode-vanilla: $(compile) Example.hs - $(show) Example.gbc | $(normalize) + $(show) Example.gbc | ./normalize show-bytecode-breakpoints: $(compile) -fbreak-points Example.hs - $(show) Example.gbc | $(normalize) + $(show) Example.gbc | ./normalize show-bytecode-hpc: $(compile) -fhpc Example.hs - $(show) Example.gbc | $(normalize) + $(show) Example.gbc | ./normalize ===================================== testsuite/tests/show-bytecode/all.T ===================================== @@ -1,18 +1,18 @@ test( 'show-bytecode-vanilla', - extra_files(['Example.hs']), + extra_files(['Example.hs', 'normalize']), makefile_test, [] ) test( 'show-bytecode-breakpoints', - extra_files(['Example.hs']), + extra_files(['Example.hs', 'normalize']), makefile_test, [] ) test( 'show-bytecode-hpc', - extra_files(['Example.hs']), + extra_files(['Example.hs', 'normalize']), makefile_test, [] ) ===================================== testsuite/tests/show-bytecode/normalize ===================================== @@ -0,0 +1,26 @@ +#!/usr/bin/env bash + +set -e -o pipefail + +stabilize () +{ + sed -E -e ' + s/_r[[:alnum:]]+/_@name_suffix@/g + s/^( *hash: )[[:xdigit:]]+/\1@hash@/g + s/^( *)[[:xdigit:]]+:/\1@hash@:/g + s/word [[:digit:]]{2}[[:digit:]]*/word @large_word@/ + ' +} + +universalize () +{ + sed -E -e ' + s/UInt[[:digit:]]+/UInt@word_size@/ + s/W[[:digit:]]+#/W@word_size@#/ + ' | + uniq + # The invocation of `uniq` is merely for collapsing adjacent entries of + # `word @large_word@`, whose number may depend on the word size. +} + +stabilize | universalize View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/4c933f62aa466a1dc960925b4c40c1b... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/4c933f62aa466a1dc960925b4c40c1b... You're receiving this email because of your account on gitlab.haskell.org. Manage all notifications: https://gitlab.haskell.org/-/profile/notifications | Help: https://gitlab.haskell.org/help
participants (1)
-
Wolfgang Jeltsch (@jeltsch)