[project @ 2001-08-22 11:45:06 by sewardj]
[ghc-hetmet.git] / ghc / tests / ccall / should_run / ffi001.hs
1 {-# OPTIONS -fglasgow-exts #-}
2
3 -- !!! A simple FFI test
4
5 -- This one provoked a bogus renamer error in 4.08.1:
6 --      panic: tcLookupGlobalValue: <THIS>.PrelIOBase.returnIO{-0B,s-}
7 -- (the error was actually in DsMonad.dsLookupGlobalValue!)
8
9 module Main where
10
11 import Foreign
12
13 foreign export ccall "gccd" mygcd :: Int -> Int -> Int 
14
15 main = putStrLn "No bug"
16
17 mygcd a b = if (a==b) then a 
18             else if (a<b) then mygcd a (b-a)
19             else mygcd (a-b) a