summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2022-11-22 14:30:21 -0500
committerBen Gamari <ben@smart-cactus.org>2022-11-23 09:02:28 -0500
commitc2bb5c6f54e0f09a38960142bf6f75acc531d17a (patch)
tree833b15e07b0097239d0c0dda77306b5c5fb1836c
parentab19f780beb63471c0c8713124054671a6b9c945 (diff)
downloadhaskell-wip/T22484.tar.gz
testsuite: Don't use grep -q in unpack_sums_7wip/T22484
`grep -q` closes stdin as soon as it finds the pattern it is looking for, resulting in #22484.
-rw-r--r--testsuite/tests/unboxedsums/Makefile2
-rw-r--r--testsuite/tests/unboxedsums/all.T2
-rw-r--r--testsuite/tests/unboxedsums/unpack_sums_7.hs3
-rw-r--r--testsuite/tests/unboxedsums/unpack_sums_7.stderr2
-rw-r--r--testsuite/tests/unboxedsums/unpack_sums_7.stdout2
5 files changed, 4 insertions, 7 deletions
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): <stdout>: hFlush: resource vanished (Broken pipe)
-Exception during Weak# finalization (ignored): <stdout>: 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)