Repository : ssh://darcs.haskell.org//srv/darcs/testsuite

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/5f268d021a2ed0924d30929ff7383687d02171ce

>---------------------------------------------------------------

commit 5f268d021a2ed0924d30929ff7383687d02171ce
Author: Ian Lynagh <[email protected]>
Date:   Sat Feb 25 17:57:00 2012 +0000

    Add a test for FFI decl parsing
    
    We were parsing "staticfoo" as "static foo".

>---------------------------------------------------------------

 tests/ffi/should_run/all.T                         |    5 +++++
 tests/ffi/should_run/ffi_parsing_001.hs            |    8 ++++++++
 .../should_run/ffi_parsing_001.stdout}             |    0 
 tests/ffi/should_run/ffi_parsing_001_c.c           |    8 ++++++++
 4 files changed, 21 insertions(+), 0 deletions(-)

diff --git a/tests/ffi/should_run/all.T b/tests/ffi/should_run/all.T
index 83fe614..a8c3553 100644
--- a/tests/ffi/should_run/all.T
+++ b/tests/ffi/should_run/all.T
@@ -201,3 +201,8 @@ test('Capi_Ctype_002',
      run_command,
      ['$MAKE -s --no-print-directory Capi_Ctype_002'])
 
+test('ffi_parsing_001',
+     extra_clean(['ffi_parsing_001_c.o']),
+     compile_and_run,
+     ['ffi_parsing_001_c.c'])
+
diff --git a/tests/ffi/should_run/ffi_parsing_001.hs 
b/tests/ffi/should_run/ffi_parsing_001.hs
new file mode 100644
index 0000000..a87a82c
--- /dev/null
+++ b/tests/ffi/should_run/ffi_parsing_001.hs
@@ -0,0 +1,8 @@
+
+import Foreign.C
+
+-- This should not be parsed as "static foo", importing "foo"
+foreign import ccall "staticfoo" x :: CInt
+
+main :: IO ()
+main = print x
diff --git a/tests/codeGen/should_run/3561.stdout 
b/tests/ffi/should_run/ffi_parsing_001.stdout
similarity index 100%
copy from tests/codeGen/should_run/3561.stdout
copy to tests/ffi/should_run/ffi_parsing_001.stdout
diff --git a/tests/ffi/should_run/ffi_parsing_001_c.c 
b/tests/ffi/should_run/ffi_parsing_001_c.c
new file mode 100644
index 0000000..56d5048
--- /dev/null
+++ b/tests/ffi/should_run/ffi_parsing_001_c.c
@@ -0,0 +1,8 @@
+
+int staticfoo(void) {
+    return 5;
+}
+
+int foo(void) {
+    return 8;
+}



_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to