summaryrefslogtreecommitdiff
path: root/testsuite/tests/unboxedsums
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2022-11-22 14:30:21 -0500
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-11-29 03:11:25 -0500
commitdef47dd32491311289bff26230b664c895f178cc (patch)
tree7760f6da18a05b0f147b7e8ef405234edc69c91c /testsuite/tests/unboxedsums
parentab23dc5e04a79f160e22869cbf604b59e885fd30 (diff)
downloadhaskell-def47dd32491311289bff26230b664c895f178cc.tar.gz
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.
Diffstat (limited to 'testsuite/tests/unboxedsums')
-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)