From: sof Date: Thu, 5 Mar 1998 20:34:15 +0000 (+0000) Subject: [project @ 1998-03-05 20:34:11 by sof] X-Git-Tag: Approx_2487_patches~885 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=d2b31525a24090681e0550ee9c07fb97bbb90ac4;p=ghc-hetmet.git [project @ 1998-03-05 20:34:11 by sof] Exercise defaulting of _ccall_ results (bot not args) to () --- diff --git a/ghc/tests/ccall/should_compile/cc002.hs b/ghc/tests/ccall/should_compile/cc002.hs new file mode 100644 index 0000000..d3ed1f1 --- /dev/null +++ b/ghc/tests/ccall/should_compile/cc002.hs @@ -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 index 0000000..f0dd58c --- /dev/null +++ b/ghc/tests/ccall/should_fail/cc001.hs @@ -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 index 0000000..33177e4 --- /dev/null +++ b/ghc/tests/ccall/should_fail/cc001.stderr @@ -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