summaryrefslogtreecommitdiff
path: root/testsuite/tests/codeGen/should_run/T20735/T20735.hs
blob: 6d691bd41f45bd6202d80e8d5e0a08d1981a0190 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
{-# LANGUAGE ForeignFunctionInterface #-}

module Main (main) where

import Data.Int
import System.IO

foreign import ccall "func64" func64 :: Int64 -> IO Int64
foreign import ccall "func32" func32 :: Int32 -> IO Int32
foreign import ccall "func16" func16 :: Int16 -> IO Int16
foreign import ccall "func8"  func8  :: Int8  -> IO Int8

main :: IO ()
main = do
    func64 (-2) >>= print >> hFlush stdout
    func32 (-2) >>= print >> hFlush stdout
    func16 (-2) >>= print >> hFlush stdout
    func8  (-2) >>= print >> hFlush stdout