summaryrefslogtreecommitdiff
path: root/testsuite/tests/ghc-regress/ffi/should_run/ffi001.hs
blob: 864b0bda45cc945548586ba9d00673d0f19f0d17 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19


-- !!! A simple FFI test

-- This one provoked a bogus renamer error in 4.08.1:
--	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 

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