summaryrefslogtreecommitdiff
path: root/testsuite/tests/codeGen/should_compile/cg011.hs
blob: 5d80968547050ba66549288197aca7eb508b63b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
{-# LANGUAGE CPP, MagicHash, BlockArguments, UnboxedTuples #-}

-- Tests compilation for interlockedExchange primop.

module M where

import GHC.Exts (interlockedExchangeInt#, Int#, Addr#, State# )

swap :: Addr# -> Int# -> State# s -> (# #)
swap ptr val s = case (interlockedExchangeInt# ptr val s) of
            (# s2, old_val #) -> (# #)