From d2b31525a24090681e0550ee9c07fb97bbb90ac4 Mon Sep 17 00:00:00 2001 From: sof Date: Thu, 5 Mar 1998 20:34:15 +0000 Subject: [PATCH] [project @ 1998-03-05 20:34:11 by sof] Exercise defaulting of _ccall_ results (bot not args) to () --- ghc/tests/ccall/should_compile/cc002.hs | 9 +++++++++ ghc/tests/ccall/should_fail/cc001.hs | 5 +++++ ghc/tests/ccall/should_fail/cc001.stderr | 7 +++++++ 3 files changed, 21 insertions(+) create mode 100644 ghc/tests/ccall/should_compile/cc002.hs create mode 100644 ghc/tests/ccall/should_fail/cc001.hs create mode 100644 ghc/tests/ccall/should_fail/cc001.stderr 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 -- 1.7.10.4