summaryrefslogtreecommitdiff
path: root/testsuite/tests/rts/T5423.hs
blob: cda87048d7eabcc21d60392ed95ec597e8403c60 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19

{-# LANGUAGE MagicHash, GHCForeignImportPrim, UnliftedFFITypes #-}

import GHC.Exts

foreign import prim "test" test :: Int# -> Int# -> Int# -> Int# -> Int#
                                -> Int# -> Int# -> Int# -> Int# -> Int#
                                -> Int#

foreign import ccall "flush_stdout" flush_stdout :: IO ()

v :: Int
v = I# (test 111# 112# 113# 114# 115# 116# 117# 118# 119# 120#)

main :: IO ()
main = do
  n <- return $! v
  flush_stdout -- Ensure that libc output buffer is flushed
  print n