diff options
Diffstat (limited to 'testsuite/tests')
-rw-r--r-- | testsuite/tests/stranal/sigs/T18086.hs | 23 | ||||
-rw-r--r-- | testsuite/tests/stranal/sigs/T18086.stderr | 21 | ||||
-rw-r--r-- | testsuite/tests/stranal/sigs/all.T | 1 |
3 files changed, 45 insertions, 0 deletions
diff --git a/testsuite/tests/stranal/sigs/T18086.hs b/testsuite/tests/stranal/sigs/T18086.hs new file mode 100644 index 0000000000..639409adce --- /dev/null +++ b/testsuite/tests/stranal/sigs/T18086.hs @@ -0,0 +1,23 @@ +{-# OPTIONS_GHC -O2 -fforce-recomp #-} +module T18086 where + +import GHC.Stack +import GHC.Utils.Panic.Plain +import Control.Exception +import System.IO.Unsafe + +-- Should have strictness signature <L,U>x, emphasis on the exceptional +-- divergence result. +m :: IO () +m = do + putStrLn "foo" + error "bar" + +-- Dito, just in a more complex scenario (the original reproducer of #18086) +panic :: String -> a +panic x = unsafeDupablePerformIO $ do + stack <- ccsToStrings =<< getCurrentCCS x + if null stack + then throw (PlainPanic x) + else throw (PlainPanic (x ++ '\n' : renderStack stack)) + diff --git a/testsuite/tests/stranal/sigs/T18086.stderr b/testsuite/tests/stranal/sigs/T18086.stderr new file mode 100644 index 0000000000..6941e233f8 --- /dev/null +++ b/testsuite/tests/stranal/sigs/T18086.stderr @@ -0,0 +1,21 @@ + +==================== Strictness signatures ==================== +T18086.$trModule: +T18086.m: <L,U>x +T18086.panic: <L,U>x + + + +==================== Cpr signatures ==================== +T18086.$trModule: +T18086.m: b +T18086.panic: + + + +==================== Strictness signatures ==================== +T18086.$trModule: +T18086.m: <L,U>x +T18086.panic: <L,U>x + + diff --git a/testsuite/tests/stranal/sigs/all.T b/testsuite/tests/stranal/sigs/all.T index 8802389cb4..387a1a7f7d 100644 --- a/testsuite/tests/stranal/sigs/all.T +++ b/testsuite/tests/stranal/sigs/all.T @@ -22,3 +22,4 @@ test('T5075', normal, compile, ['']) test('T17932', normal, compile, ['']) test('T13380c', expect_broken('!3014'), compile, ['']) test('T13380f', normal, compile, ['']) +test('T18086', normal, compile, ['-package ghc']) |