diff options
Diffstat (limited to 'testsuite/tests/stranal/should_run/T22475b.hs')
-rw-r--r-- | testsuite/tests/stranal/should_run/T22475b.hs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/testsuite/tests/stranal/should_run/T22475b.hs b/testsuite/tests/stranal/should_run/T22475b.hs new file mode 100644 index 0000000000..965d7e0fc8 --- /dev/null +++ b/testsuite/tests/stranal/should_run/T22475b.hs @@ -0,0 +1,21 @@ +{-# OPTIONS_GHC -O -fforce-recomp #-} +{-# OPTIONS_GHC -fmax-worker-args=0 #-} + +data Config + = Cfg + { a :: Integer + , params :: !(Maybe Int) + } + +use :: Bool -> Config -> Int +use True cfg = a cfg `seq` 42 +use _ _ = 0 +{-# NOINLINE use #-} + +run :: Config -> Int -> Int +run conf n = + let !conf' = conf{params=Just n} + in use True conf' + use False conf' +{-# NOINLINE run #-} + +main = print $ run (Cfg 0 (Just 1)) 13 |