[project @ 1998-03-05 20:34:11 by sof]
authorsof <unknown>
Thu, 5 Mar 1998 20:34:15 +0000 (20:34 +0000)
committersof <unknown>
Thu, 5 Mar 1998 20:34:15 +0000 (20:34 +0000)
Exercise defaulting of _ccall_ results (bot not args) to ()

ghc/tests/ccall/should_compile/cc002.hs [new file with mode: 0644]
ghc/tests/ccall/should_fail/cc001.hs [new file with mode: 0644]
ghc/tests/ccall/should_fail/cc001.stderr [new file with mode: 0644]

diff --git a/ghc/tests/ccall/should_compile/cc002.hs b/ghc/tests/ccall/should_compile/cc002.hs
new file mode 100644 (file)
index 0000000..d3ed1f1
--- /dev/null
@@ -0,0 +1,9 @@
+--!!! cc002 -- ccall with ambiguous result (should be defaulted to ())
+module ShouldCompile where
+
+a :: IO ()
+a = do
+ _ccall_ a
+ return ()
+
+       
diff --git a/ghc/tests/ccall/should_fail/cc001.hs b/ghc/tests/ccall/should_fail/cc001.hs
new file mode 100644 (file)
index 0000000..f0dd58c
--- /dev/null
@@ -0,0 +1,5 @@
+--!!! cc002 -- ccall with ambiguous argument
+module Test where
+
+f :: IO ()
+f = _ccall_ foo (undefined ())
diff --git a/ghc/tests/ccall/should_fail/cc001.stderr b/ghc/tests/ccall/should_fail/cc001.stderr
new file mode 100644 (file)
index 0000000..33177e4
--- /dev/null
@@ -0,0 +1,7 @@
+cc001.hs:5:
+    Cannot resolve the ambiguous context (PrelGHC.CCallable aJC)
+       `PrelGHC.CCallable aJC' arising from an argument in the _ccall_ to `foo', namely `(Prelude.undefined ())' at cc001.hs:5
+
+
+Compilation had errors