summaryrefslogtreecommitdiff
path: root/testsuite/tests/simplCore/should_run/T15840.hs
blob: e844f9db5b359a4dc8c10feb58b5794aa79209f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
module Main (main) where

data T = MkT !Bool

f :: T -> Bool
f _ = False
{-# NOINLINE f #-}

{-# RULES "non-det" [1] forall x. f (MkT x) = x #-}

main :: IO ()
main = print (f (MkT True))
-- Prints `True` if the rule fires, or `False` is the wrapper for `MkT` inlines
-- in phase 2, preventing the rule from being triggered in phase 1.