[commit: testsuite] master: Test Trac #3333 (25b9c96)

git at git.haskell.org git at git.haskell.org
Fri Oct 25 14:23:34 UTC 2013


Repository : ssh://git@git.haskell.org/testsuite

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/25b9c963ce9a3a2394f1e4750e865b69ce7cb607/testsuite

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

commit 25b9c963ce9a3a2394f1e4750e865b69ce7cb607
Author: Takano Akio <aljee at hyper.cx>
Date:   Sun Jan 13 14:37:16 2013 +0900

    Test Trac #3333
    
    Signed-off-by: Austin Seipp <austin at well-typed.com>


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

25b9c963ce9a3a2394f1e4750e865b69ce7cb607
 tests/ghci/linking/Makefile                                       |    4 ++++
 tests/ghci/linking/T3333.c                                        |    4 ++++
 tests/ghci/linking/T3333.hs                                       |    5 +++++
 .../should_run/cgrun040.stdout => ghci/linking/T3333.stdout}      |    0
 tests/ghci/linking/all.T                                          |    5 +++++
 5 files changed, 18 insertions(+)

diff --git a/tests/ghci/linking/Makefile b/tests/ghci/linking/Makefile
index 2f53b6b..60cb9cb 100644
--- a/tests/ghci/linking/Makefile
+++ b/tests/ghci/linking/Makefile
@@ -117,3 +117,7 @@ ghcilink006 :
 	#
 	echo ":q" | "$(TEST_HC)" --interactive -ignore-dot-ghci -v0 -package-db $(LOCAL_PKGCONF006) -package test
 
+.PHONY: T3333
+T3333:
+	"$(TEST_HC)" -c T3333.c -o T3333.o
+	echo "weak_test 10" | "$(TEST_HC)" --interactive -ignore-dot-ghci -v0 T3333.hs T3333.o
diff --git a/tests/ghci/linking/T3333.c b/tests/ghci/linking/T3333.c
new file mode 100644
index 0000000..92fe332
--- /dev/null
+++ b/tests/ghci/linking/T3333.c
@@ -0,0 +1,4 @@
+
+int weak_test(int) __attribute__((weak));
+
+int weak_test(int x) {return x + 1;}
diff --git a/tests/ghci/linking/T3333.hs b/tests/ghci/linking/T3333.hs
new file mode 100644
index 0000000..82c8909
--- /dev/null
+++ b/tests/ghci/linking/T3333.hs
@@ -0,0 +1,5 @@
+module WeakTest where
+
+import Foreign.C.Types
+
+foreign import ccall weak_test :: CInt -> IO CInt
diff --git a/tests/codeGen/should_run/cgrun040.stdout b/tests/ghci/linking/T3333.stdout
similarity index 100%
copy from tests/codeGen/should_run/cgrun040.stdout
copy to tests/ghci/linking/T3333.stdout
diff --git a/tests/ghci/linking/all.T b/tests/ghci/linking/all.T
index 1a793d2..38ec046 100644
--- a/tests/ghci/linking/all.T
+++ b/tests/ghci/linking/all.T
@@ -40,3 +40,8 @@ test('ghcilink006',
      ],
      run_command,
      ['$MAKE -s --no-print-directory ghcilink006'])
+
+test('T3333',
+     [extra_clean('T3333.o'), unless(doing_ghci, skip), unless(opsys('linux'), expect_broken(3333))],
+     run_command,
+     ['$MAKE -s --no-print-directory T3333'])



More information about the ghc-commits mailing list