summaryrefslogtreecommitdiff
path: root/tests/examples/ghc86/ffi1.hs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/examples/ghc86/ffi1.hs')
-rw-r--r--tests/examples/ghc86/ffi1.hs12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/examples/ghc86/ffi1.hs b/tests/examples/ghc86/ffi1.hs
new file mode 100644
index 0000000..a1a2d79
--- /dev/null
+++ b/tests/examples/ghc86/ffi1.hs
@@ -0,0 +1,12 @@
+{-# LANGUAGE UnboxedSums, UnboxedTuples, MagicHash #-}
+
+module Lib where
+
+import GHC.Prim
+
+-- Can't unboxed tuples and sums to FFI, we should fail appropriately.
+
+foreign import ccall "f1" f1 :: (# Int | Int #) -> IO Int
+foreign import ccall "f2" f2 :: (# (# Int, Int #) | (# Float#, Float# #) #) -> IO Int
+foreign import ccall "f3" f3 :: (# (# #) | Void# | (# Int# | String #) #) -> IO Int
+