summaryrefslogtreecommitdiff
path: root/testsuite/tests
diff options
context:
space:
mode:
authorKrzysztof Gogolewski <krzysztof.gogolewski@tweag.io>2023-03-20 18:41:07 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2023-04-11 19:24:54 -0400
commitb7474b57830261a94903da61bb2df33022c11357 (patch)
tree8f2cb3be8d7d1a926e85d4f501059196dce2a798 /testsuite/tests
parentbc4795d207c132fbfe118958f7f39b140115f5bd (diff)
downloadhaskell-b7474b57830261a94903da61bb2df33022c11357.tar.gz
Add missing cases in -Di prettyprinter
Fixes #23142
Diffstat (limited to 'testsuite/tests')
-rw-r--r--testsuite/tests/rts/Makefile10
-rw-r--r--testsuite/tests/rts/T23142.hs18
-rw-r--r--testsuite/tests/rts/T23142.stdout5
-rw-r--r--testsuite/tests/rts/all.T2
4 files changed, 35 insertions, 0 deletions
diff --git a/testsuite/tests/rts/Makefile b/testsuite/tests/rts/Makefile
index d7bb87ae91..d6e7b047d8 100644
--- a/testsuite/tests/rts/Makefile
+++ b/testsuite/tests/rts/Makefile
@@ -147,3 +147,13 @@ EventlogOutput_IPE:
"$(TEST_HC)" -debug -finfo-table-map -v0 EventlogOutput.hs
./EventlogOutput +RTS -va 2> EventlogOutput_IPE.stderr.log
grep "IPE:" EventlogOutput_IPE.stderr.log
+
+.PHONY: T23142
+T23142:
+ # Test that the -Di output contains different frames
+ "$(TEST_HC)" --run -ignore-dot-ghci T23142.hs +RTS -Di -RTS 2> T23142.log
+ grep -m1 -c "ATOMICALLY_FRAME" T23142.log
+ grep -m1 -c "CATCH_RETRY_FRAME" T23142.log
+ grep -m1 -c "CATCH_STM_FRAME" T23142.log
+ grep -m1 -c "MUT_ARR_PTRS_FROZEN_DIRTY" T23142.log
+ grep -m1 -c "SMALL_MUT_ARR_PTRS_FROZEN_DIRTY" T23142.log
diff --git a/testsuite/tests/rts/T23142.hs b/testsuite/tests/rts/T23142.hs
new file mode 100644
index 0000000000..75e255c68f
--- /dev/null
+++ b/testsuite/tests/rts/T23142.hs
@@ -0,0 +1,18 @@
+{-# LANGUAGE UnboxedTuples, MagicHash #-}
+module T23142 where
+
+import GHC.IO
+import GHC.Exts
+
+main :: IO ()
+main = IO (\s -> case newArray# 10# (2 :: Int) s of
+ (# s', a #) -> case unsafeFreezeArray# a s' of
+ (# s'', _ #) -> (# s'', () #))
+ >>
+ IO (\s -> case newSmallArray# 10# (2 :: Int) s of
+ (# s', a #) -> case unsafeFreezeSmallArray# a s' of
+ (# s'', _ #) -> (# s'', () #))
+ >>
+ IO (atomically# (\s -> catchSTM# (\s -> (# s, () #)) (\_ s -> (# s, () #)) s))
+ >>
+ IO (atomically# (\s -> catchRetry# (\s -> (# s, () #)) (\s -> (# s, () #)) s))
diff --git a/testsuite/tests/rts/T23142.stdout b/testsuite/tests/rts/T23142.stdout
new file mode 100644
index 0000000000..627e1097cd
--- /dev/null
+++ b/testsuite/tests/rts/T23142.stdout
@@ -0,0 +1,5 @@
+1
+1
+1
+1
+1
diff --git a/testsuite/tests/rts/all.T b/testsuite/tests/rts/all.T
index ba18e32d35..64b21cbc89 100644
--- a/testsuite/tests/rts/all.T
+++ b/testsuite/tests/rts/all.T
@@ -575,3 +575,5 @@ test('T22795b', [only_ways(['normal']), js_skip], compile_and_run, ['-single-thr
test('T22795c', [only_ways(['normal']), js_skip], compile_and_run, ['-threaded -single-threaded'])
test('T17574', [js_skip], compile_and_run, ['-with-rtsopts -T'])
+
+test('T23142', [unless(debug_rts(), skip), req_interp], makefile_test, ['T23142'])