summaryrefslogtreecommitdiff
path: root/testsuite/tests/ffi/should_run/ffi001.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/ffi/should_run/ffi001.hs')
-rw-r--r--testsuite/tests/ffi/should_run/ffi001.hs19
1 files changed, 19 insertions, 0 deletions
diff --git a/testsuite/tests/ffi/should_run/ffi001.hs b/testsuite/tests/ffi/should_run/ffi001.hs
new file mode 100644
index 0000000000..864b0bda45
--- /dev/null
+++ b/testsuite/tests/ffi/should_run/ffi001.hs
@@ -0,0 +1,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