summaryrefslogtreecommitdiff
path: root/testsuite/tests/ffi
diff options
context:
space:
mode:
authorThomas Miedema <thomasmiedema@gmail.com>2016-02-22 21:32:51 +0100
committerThomas Miedema <thomasmiedema@gmail.com>2016-02-23 12:27:57 +0100
commit6074c108b66ec9cd2230852addb60782a8b17e0a (patch)
treef63eca7bf384b63a70fa19888c4288ab1243ce12 /testsuite/tests/ffi
parent754a2f2bb7416bd7fe453ba7bcb7c089f5ef3b8f (diff)
downloadhaskell-6074c108b66ec9cd2230852addb60782a8b17e0a.tar.gz
Testsuite: delete Windows line endings [skip ci] (#11631)
Diffstat (limited to 'testsuite/tests/ffi')
-rw-r--r--testsuite/tests/ffi/should_compile/ffi-deriv1.hs50
-rw-r--r--testsuite/tests/ffi/should_run/T1288.hs12
-rw-r--r--testsuite/tests/ffi/should_run/T1288_ghci.hs12
-rw-r--r--testsuite/tests/ffi/should_run/T2276.hs14
-rw-r--r--testsuite/tests/ffi/should_run/T2276_ghci.hs14
-rw-r--r--testsuite/tests/ffi/should_run/ffi014.hs58
6 files changed, 80 insertions, 80 deletions
diff --git a/testsuite/tests/ffi/should_compile/ffi-deriv1.hs b/testsuite/tests/ffi/should_compile/ffi-deriv1.hs
index 1e5d27a0b6..dba0eaa460 100644
--- a/testsuite/tests/ffi/should_compile/ffi-deriv1.hs
+++ b/testsuite/tests/ffi/should_compile/ffi-deriv1.hs
@@ -1,25 +1,25 @@
-{-# LANGUAGE GeneralizedNewtypeDeriving #-}
-
--- Tests newtype unwrapping for the IO monad itself
--- Notice the RenderM monad, which is used in the
--- type of the callback function
-
-module ShouldCompile where
-
-import Control.Applicative (Applicative)
-
-import Foreign.Ptr
-newtype RenderM a = RenderM (IO a) deriving (Functor, Applicative, Monad)
-
-type RenderCallback = Int -> Int -> RenderM ()
-
-foreign import ccall duma_onRender :: FunPtr RenderCallback -> RenderM ()
-
-foreign import ccall "wrapper" mkRenderCallback
- :: RenderCallback -> RenderM (FunPtr RenderCallback)
-
-onRender :: RenderCallback -> RenderM ()
-onRender f = mkRenderCallback f >>= duma_onRender
-
-
-
+{-# LANGUAGE GeneralizedNewtypeDeriving #-}
+
+-- Tests newtype unwrapping for the IO monad itself
+-- Notice the RenderM monad, which is used in the
+-- type of the callback function
+
+module ShouldCompile where
+
+import Control.Applicative (Applicative)
+
+import Foreign.Ptr
+newtype RenderM a = RenderM (IO a) deriving (Functor, Applicative, Monad)
+
+type RenderCallback = Int -> Int -> RenderM ()
+
+foreign import ccall duma_onRender :: FunPtr RenderCallback -> RenderM ()
+
+foreign import ccall "wrapper" mkRenderCallback
+ :: RenderCallback -> RenderM (FunPtr RenderCallback)
+
+onRender :: RenderCallback -> RenderM ()
+onRender f = mkRenderCallback f >>= duma_onRender
+
+
+
diff --git a/testsuite/tests/ffi/should_run/T1288.hs b/testsuite/tests/ffi/should_run/T1288.hs
index 8b3a8f8417..c57b7c449d 100644
--- a/testsuite/tests/ffi/should_run/T1288.hs
+++ b/testsuite/tests/ffi/should_run/T1288.hs
@@ -1,6 +1,6 @@
-import Foreign
-import Foreign.C
-
-foreign import stdcall "test" ctest :: CInt -> IO ()
-
-main = ctest 3
+import Foreign
+import Foreign.C
+
+foreign import stdcall "test" ctest :: CInt -> IO ()
+
+main = ctest 3
diff --git a/testsuite/tests/ffi/should_run/T1288_ghci.hs b/testsuite/tests/ffi/should_run/T1288_ghci.hs
index 8b3a8f8417..c57b7c449d 100644
--- a/testsuite/tests/ffi/should_run/T1288_ghci.hs
+++ b/testsuite/tests/ffi/should_run/T1288_ghci.hs
@@ -1,6 +1,6 @@
-import Foreign
-import Foreign.C
-
-foreign import stdcall "test" ctest :: CInt -> IO ()
-
-main = ctest 3
+import Foreign
+import Foreign.C
+
+foreign import stdcall "test" ctest :: CInt -> IO ()
+
+main = ctest 3
diff --git a/testsuite/tests/ffi/should_run/T2276.hs b/testsuite/tests/ffi/should_run/T2276.hs
index 0ee1ee91ff..c7b14bd60d 100644
--- a/testsuite/tests/ffi/should_run/T2276.hs
+++ b/testsuite/tests/ffi/should_run/T2276.hs
@@ -1,7 +1,7 @@
-import Foreign
-import Foreign.C
-
-foreign import stdcall "&test" ptest :: FunPtr (CInt -> IO ())
-foreign import stdcall "dynamic" ctest :: FunPtr (CInt -> IO ()) -> CInt -> IO ()
-
-main = ctest ptest 3
+import Foreign
+import Foreign.C
+
+foreign import stdcall "&test" ptest :: FunPtr (CInt -> IO ())
+foreign import stdcall "dynamic" ctest :: FunPtr (CInt -> IO ()) -> CInt -> IO ()
+
+main = ctest ptest 3
diff --git a/testsuite/tests/ffi/should_run/T2276_ghci.hs b/testsuite/tests/ffi/should_run/T2276_ghci.hs
index 0ee1ee91ff..c7b14bd60d 100644
--- a/testsuite/tests/ffi/should_run/T2276_ghci.hs
+++ b/testsuite/tests/ffi/should_run/T2276_ghci.hs
@@ -1,7 +1,7 @@
-import Foreign
-import Foreign.C
-
-foreign import stdcall "&test" ptest :: FunPtr (CInt -> IO ())
-foreign import stdcall "dynamic" ctest :: FunPtr (CInt -> IO ()) -> CInt -> IO ()
-
-main = ctest ptest 3
+import Foreign
+import Foreign.C
+
+foreign import stdcall "&test" ptest :: FunPtr (CInt -> IO ())
+foreign import stdcall "dynamic" ctest :: FunPtr (CInt -> IO ()) -> CInt -> IO ()
+
+main = ctest ptest 3
diff --git a/testsuite/tests/ffi/should_run/ffi014.hs b/testsuite/tests/ffi/should_run/ffi014.hs
index 4434bef21a..8a1a2864c3 100644
--- a/testsuite/tests/ffi/should_run/ffi014.hs
+++ b/testsuite/tests/ffi/should_run/ffi014.hs
@@ -1,29 +1,29 @@
--- exposed a bug in GHC 6.4 threaded RTS, fixed in Schedule.c rev. 1.232
-
-module Main where
-
-import Control.Concurrent
-import Control.Monad
-import Foreign.Ptr
-import Data.IORef
-
-main = do
- ms <- replicateM 100 $ do putStrLn "."
- m <- newEmptyMVar
- forkOS (thread >> putMVar m ())
- thread
- return m
- mapM takeMVar ms
-
-thread = do var <- newIORef 0
- let f = modifyIORef var (1+)
- callC =<< mkFunc f
-
-type FUNC = IO ()
-
-foreign import ccall unsafe "wrapper"
- mkFunc :: FUNC -> IO (FunPtr FUNC)
-
-foreign import ccall safe "ffi014_cbits.h callC"
- callC:: FunPtr FUNC -> IO ()
-
+-- exposed a bug in GHC 6.4 threaded RTS, fixed in Schedule.c rev. 1.232
+
+module Main where
+
+import Control.Concurrent
+import Control.Monad
+import Foreign.Ptr
+import Data.IORef
+
+main = do
+ ms <- replicateM 100 $ do putStrLn "."
+ m <- newEmptyMVar
+ forkOS (thread >> putMVar m ())
+ thread
+ return m
+ mapM takeMVar ms
+
+thread = do var <- newIORef 0
+ let f = modifyIORef var (1+)
+ callC =<< mkFunc f
+
+type FUNC = IO ()
+
+foreign import ccall unsafe "wrapper"
+ mkFunc :: FUNC -> IO (FunPtr FUNC)
+
+foreign import ccall safe "ffi014_cbits.h callC"
+ callC:: FunPtr FUNC -> IO ()
+