summaryrefslogtreecommitdiff
path: root/testsuite/tests/ffi
diff options
context:
space:
mode:
authorThomas Miedema <thomasmiedema@gmail.com>2016-06-18 22:44:19 +0200
committerThomas Miedema <thomasmiedema@gmail.com>2016-06-20 16:22:07 +0200
commit46ff80f26d1892e1b50e3f10c5d3fded33da6e81 (patch)
treec53fd835b689b6b64a729a42e4cc6482d8fb5215 /testsuite/tests/ffi
parent7e7094f166b6e475a49e20b98cbca851334aedaf (diff)
downloadhaskell-46ff80f26d1892e1b50e3f10c5d3fded33da6e81.tar.gz
Testsuite: tabs -> spaces [skip ci]
Diffstat (limited to 'testsuite/tests/ffi')
-rw-r--r--testsuite/tests/ffi/should_compile/cc001.hs10
-rw-r--r--testsuite/tests/ffi/should_compile/cc004.hs26
-rw-r--r--testsuite/tests/ffi/should_compile/cc005.hs64
-rw-r--r--testsuite/tests/ffi/should_fail/ccfail002.hs4
-rw-r--r--testsuite/tests/ffi/should_run/fed001.hs8
-rw-r--r--testsuite/tests/ffi/should_run/ffi001.hs10
-rw-r--r--testsuite/tests/ffi/should_run/ffi004.hs24
-rw-r--r--testsuite/tests/ffi/should_run/ffi013.hs8
8 files changed, 77 insertions, 77 deletions
diff --git a/testsuite/tests/ffi/should_compile/cc001.hs b/testsuite/tests/ffi/should_compile/cc001.hs
index cd7318d000..b93b51cd6b 100644
--- a/testsuite/tests/ffi/should_compile/cc001.hs
+++ b/testsuite/tests/ffi/should_compile/cc001.hs
@@ -8,14 +8,14 @@ foreign import ccall unsafe "a" a :: IO Int
foreign import ccall unsafe "b" b :: Int -> IO Int
-foreign import ccall unsafe "c"
+foreign import ccall unsafe "c"
c :: Int -> Char -> Float -> Double -> IO Float
-- simple monadic code
-d = a >>= \ x ->
- b x >>= \ y ->
- c y 'f' 1.0 2.0
+d = a >>= \ x ->
+ b x >>= \ y ->
+ c y 'f' 1.0 2.0
+
-
diff --git a/testsuite/tests/ffi/should_compile/cc004.hs b/testsuite/tests/ffi/should_compile/cc004.hs
index 89c2aa8319..915f054a0c 100644
--- a/testsuite/tests/ffi/should_compile/cc004.hs
+++ b/testsuite/tests/ffi/should_compile/cc004.hs
@@ -34,19 +34,19 @@ foreign import stdcall "dynamic" d64 :: FunPtr (IO Int64) -> IO Int64
foreign import ccall unsafe "kitchen"
sink :: Ptr a
-> ByteArray#
- -> MutableByteArray# RealWorld
- -> Int
- -> Int8
- -> Int16
- -> Int32
- -> Int64
- -> Word8
- -> Word16
- -> Word32
- -> Word64
- -> Float
- -> Double
- -> IO ()
+ -> MutableByteArray# RealWorld
+ -> Int
+ -> Int8
+ -> Int16
+ -> Int32
+ -> Int64
+ -> Word8
+ -> Word16
+ -> Word32
+ -> Word64
+ -> Float
+ -> Double
+ -> IO ()
type Sink2 b = Ptr b
diff --git a/testsuite/tests/ffi/should_compile/cc005.hs b/testsuite/tests/ffi/should_compile/cc005.hs
index 7086480bfe..3770d54cdf 100644
--- a/testsuite/tests/ffi/should_compile/cc005.hs
+++ b/testsuite/tests/ffi/should_compile/cc005.hs
@@ -66,43 +66,43 @@ d64 = undefined
foreign export ccall "kitchen"
- sink :: --ForeignObj
--- -> ByteArray Int
--- -> MutableByteArray Int RealWorld
- Int
- -> Int8
- -> Int16
- -> Int32
- -> Int64
- -> Word8
- -> Word16
- -> Word32
- -> Word64
- -> Float
- -> Double
- -> IO Int
+ sink :: --ForeignObj
+-- -> ByteArray Int
+-- -> MutableByteArray Int RealWorld
+ Int
+ -> Int8
+ -> Int16
+ -> Int32
+ -> Int64
+ -> Word8
+ -> Word16
+ -> Word32
+ -> Word64
+ -> Float
+ -> Double
+ -> IO Int
sink = undefined
sink2 = undefined
foreign export ccall dynamic
- sink2 :: (--ForeignObj
--- -> ByteArray Int
--- -> MutableByteArray Int RealWorld
- StablePtr a
- -> Int
- -> Int8
- -> Int16
- -> Int32
- -> Int64
- -> Word8
- -> Word16
- -> Word32
- -> Word64
- -> Float
- -> Double
- -> IO ())
- -> IO Addr
+ sink2 :: (--ForeignObj
+-- -> ByteArray Int
+-- -> MutableByteArray Int RealWorld
+ StablePtr a
+ -> Int
+ -> Int8
+ -> Int16
+ -> Int32
+ -> Int64
+ -> Word8
+ -> Word16
+ -> Word32
+ -> Word64
+ -> Float
+ -> Double
+ -> IO ())
+ -> IO Addr
-}
diff --git a/testsuite/tests/ffi/should_fail/ccfail002.hs b/testsuite/tests/ffi/should_fail/ccfail002.hs
index 977faa2f7c..86d5e9a1ba 100644
--- a/testsuite/tests/ffi/should_fail/ccfail002.hs
+++ b/testsuite/tests/ffi/should_fail/ccfail002.hs
@@ -7,5 +7,5 @@ module ShouldFail where
import GHC.Exts
-foreign import ccall unsafe "foo"
- foo :: Int# -> Int# -> Int# -> (# Int# , Int#, Int# #)
+foreign import ccall unsafe "foo"
+ foo :: Int# -> Int# -> Int# -> (# Int# , Int#, Int# #)
diff --git a/testsuite/tests/ffi/should_run/fed001.hs b/testsuite/tests/ffi/should_run/fed001.hs
index a832c58ac4..8c48cc29d8 100644
--- a/testsuite/tests/ffi/should_run/fed001.hs
+++ b/testsuite/tests/ffi/should_run/fed001.hs
@@ -6,12 +6,12 @@ type CInt = Int32
type CSize = Word32
foreign import ccall "wrapper"
- mkComparator :: (Ptr Int -> Ptr Int -> IO CInt)
- -> IO (Ptr (Ptr Int -> Ptr Int -> IO CInt))
+ mkComparator :: (Ptr Int -> Ptr Int -> IO CInt)
+ -> IO (Ptr (Ptr Int -> Ptr Int -> IO CInt))
foreign import ccall
- qsort :: Ptr Int -> CSize -> CSize -> Ptr (Ptr Int -> Ptr Int -> IO CInt)
- -> IO ()
+ qsort :: Ptr Int -> CSize -> CSize -> Ptr (Ptr Int -> Ptr Int -> IO CInt)
+ -> IO ()
compareInts :: Ptr Int -> Ptr Int -> IO CInt
compareInts a1 a2 = do
diff --git a/testsuite/tests/ffi/should_run/ffi001.hs b/testsuite/tests/ffi/should_run/ffi001.hs
index 864b0bda45..42f2b3f883 100644
--- a/testsuite/tests/ffi/should_run/ffi001.hs
+++ b/testsuite/tests/ffi/should_run/ffi001.hs
@@ -3,17 +3,17 @@
-- !!! A simple FFI test
-- This one provoked a bogus renamer error in 4.08.1:
--- panic: tcLookupGlobalValue: <THIS>.PrelIOBase.returnIO{-0B,s-}
+-- panic: tcLookupGlobalValue: <THIS>.PrelIOBase.returnIO{-0B,s-}
-- (the error was actually in DsMonad.dsLookupGlobalValue!)
module Main where
import Foreign
-foreign export ccall "gccd" mygcd :: Int -> Int -> Int
+foreign export ccall "gccd" mygcd :: Int -> Int -> Int
main = putStrLn "No bug"
-mygcd a b = if (a==b) then a
- else if (a<b) then mygcd a (b-a)
- else mygcd (a-b) a
+mygcd a b = if (a==b) then a
+ else if (a<b) then mygcd a (b-a)
+ else mygcd (a-b) a
diff --git a/testsuite/tests/ffi/should_run/ffi004.hs b/testsuite/tests/ffi/should_run/ffi004.hs
index 546cd15068..c811fb3bc0 100644
--- a/testsuite/tests/ffi/should_run/ffi004.hs
+++ b/testsuite/tests/ffi/should_run/ffi004.hs
@@ -5,18 +5,18 @@
import Foreign.C
-main =
- withCString "Testing %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d\n" $ \cstr ->
+main =
+ withCString "Testing %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d\n" $ \cstr ->
printf cstr
- 0 1 2 3 4 5 6 7 8 9
- 10 11 12 13 14 15 16 17 18 19
- 20 21 22 23 24 25 26 27 28 29
- 30 31 32 33 34 35 36 37 38 39
+ 0 1 2 3 4 5 6 7 8 9
+ 10 11 12 13 14 15 16 17 18 19
+ 20 21 22 23 24 25 26 27 28 29
+ 30 31 32 33 34 35 36 37 38 39
-foreign import ccall unsafe
+foreign import ccall unsafe
printf :: CString
- -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int
- -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int
- -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int
- -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int
- -> IO ()
+ -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int
+ -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int
+ -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int
+ -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int -> Int
+ -> IO ()
diff --git a/testsuite/tests/ffi/should_run/ffi013.hs b/testsuite/tests/ffi/should_run/ffi013.hs
index ae38c71b10..6887a10db9 100644
--- a/testsuite/tests/ffi/should_run/ffi013.hs
+++ b/testsuite/tests/ffi/should_run/ffi013.hs
@@ -2,12 +2,12 @@ import Foreign
import Foreign.C.Types
foreign import ccall "wrapper"
- mkComparator :: (Ptr Int -> Ptr Int -> IO CInt)
- -> IO (FunPtr (Ptr Int -> Ptr Int -> IO CInt))
+ mkComparator :: (Ptr Int -> Ptr Int -> IO CInt)
+ -> IO (FunPtr (Ptr Int -> Ptr Int -> IO CInt))
foreign import ccall
- qsort :: Ptr Int -> CSize -> CSize -> FunPtr (Ptr Int -> Ptr Int -> IO CInt)
- -> IO ()
+ qsort :: Ptr Int -> CSize -> CSize -> FunPtr (Ptr Int -> Ptr Int -> IO CInt)
+ -> IO ()
compareInts :: Ptr Int -> Ptr Int -> IO CInt
compareInts a1 a2 = do