summaryrefslogtreecommitdiff
path: root/testsuite/tests/simplCore/should_run/T19313.hs
blob: 0297260f79e7d8b215d42d6bb86a50e634e1c6a8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
{-# LANGUAGE MagicHash #-}
module Main where

import GHC.Exts

{-# NOINLINE up #-}
up :: Int# -> Int#
up x = x +# 1#

{-# NOINLINE down #-}
down :: Int# -> Int#
down x = x -# 1#

{-# RULES "up/down" forall x. up (down x) = 42# #-}

main = do
    print (I# (up (down 1#)))