From c2bb5c6f54e0f09a38960142bf6f75acc531d17a Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Tue, 22 Nov 2022 14:30:21 -0500 Subject: testsuite: Don't use grep -q in unpack_sums_7 `grep -q` closes stdin as soon as it finds the pattern it is looking for, resulting in #22484. --- testsuite/tests/unboxedsums/Makefile | 2 +- testsuite/tests/unboxedsums/all.T | 2 +- testsuite/tests/unboxedsums/unpack_sums_7.hs | 3 --- testsuite/tests/unboxedsums/unpack_sums_7.stderr | 2 -- testsuite/tests/unboxedsums/unpack_sums_7.stdout | 2 ++ 5 files changed, 4 insertions(+), 7 deletions(-) delete mode 100644 testsuite/tests/unboxedsums/unpack_sums_7.stderr create mode 100644 testsuite/tests/unboxedsums/unpack_sums_7.stdout diff --git a/testsuite/tests/unboxedsums/Makefile b/testsuite/tests/unboxedsums/Makefile index 23548ec58c..b3652e2d19 100644 --- a/testsuite/tests/unboxedsums/Makefile +++ b/testsuite/tests/unboxedsums/Makefile @@ -6,6 +6,6 @@ include $(TOP)/mk/test.mk unpack_sums_7: $(RM) -f unpack_sums_7.o unpack_sums_7.hi - '$(TEST_HC)' $(TEST_HC_OPTS) -c unpack_sums_7.hs -O -dsuppress-all -ddump-simpl | grep -q '\(# |_ #\)' + '$(TEST_HC)' $(TEST_HC_OPTS) -c unpack_sums_7.hs -O -dsuppress-all -dsuppress-uniques -ddump-simpl | grep '\(# |_ #\)' # This is a test to check for the presence of an unboxed sum in the core for a program using UNPACK # on a sum type which is evidence that the field has been correctly unpacked. diff --git a/testsuite/tests/unboxedsums/all.T b/testsuite/tests/unboxedsums/all.T index 7327dbcfec..66ee686975 100644 --- a/testsuite/tests/unboxedsums/all.T +++ b/testsuite/tests/unboxedsums/all.T @@ -46,7 +46,7 @@ test('unpack_sums_3', normal, compile_and_run, ['-O']) test('unpack_sums_4', normal, compile_and_run, ['-O']) test('unpack_sums_5', normal, compile, ['-O']) test('unpack_sums_6', fragile(22504), compile_and_run, ['-O']) -test('unpack_sums_7', [], makefile_test, []) +test('unpack_sums_7', normal, makefile_test, []) test('unpack_sums_8', normal, compile_and_run, [""]) test('unpack_sums_9', normal, compile, [""]) diff --git a/testsuite/tests/unboxedsums/unpack_sums_7.hs b/testsuite/tests/unboxedsums/unpack_sums_7.hs index cefa317a01..7818606689 100644 --- a/testsuite/tests/unboxedsums/unpack_sums_7.hs +++ b/testsuite/tests/unboxedsums/unpack_sums_7.hs @@ -1,6 +1,3 @@ --- NB: Compiling this module throws an exception involving Weak# at the end of compilation. --- This is unrelated to unpacked sums but we need to include the error in the expected output for the test to pass. - module UnpackedSums7 where data T = MkT {-# UNPACK #-} !MI diff --git a/testsuite/tests/unboxedsums/unpack_sums_7.stderr b/testsuite/tests/unboxedsums/unpack_sums_7.stderr deleted file mode 100644 index d37b1c154a..0000000000 --- a/testsuite/tests/unboxedsums/unpack_sums_7.stderr +++ /dev/null @@ -1,2 +0,0 @@ -Exception during Weak# finalization (ignored): : hFlush: resource vanished (Broken pipe) -Exception during Weak# finalization (ignored): : hFlush: resource vanished (Broken pipe) diff --git a/testsuite/tests/unboxedsums/unpack_sums_7.stdout b/testsuite/tests/unboxedsums/unpack_sums_7.stdout new file mode 100644 index 0000000000..a0527f950e --- /dev/null +++ b/testsuite/tests/unboxedsums/unpack_sums_7.stdout @@ -0,0 +1,2 @@ + JI unbx -> (# |_ #) unbx +t = MkT ((# |_ #) t1) -- cgit v1.2.1