Add test cases that reproduce #7241.
[cabal.git] / cabal-testsuite / PackageTests / FFI / ForeignOptsC / Main.hs
blob34c10adfd99e3523c24edb1795c98b802b1d7c55
1 {-# LANGUAGE ForeignFunctionInterface #-}
3 module Main where
5 import Foreign.C (CInt (..))
7 foreign import ccall "clib.h meaning_of_life_c"
8 meaning_of_life_c :: IO CInt
10 main :: IO ()
11 main = do
12 secret <- meaning_of_life_c
13 -- The value 11 comes from __TESTOPT_C__ - see the cabal file.
14 if (secret == 11)
15 then putStrLn ("The secret is " ++ show secret)
16 else error ("Expected value 11, got " ++ show secret)