Test Trac #3333
authorTakano Akio <aljee@hyper.cx>
Sun, 13 Jan 2013 05:37:16 +0000 (14:37 +0900)
committerAustin Seipp <austin@well-typed.com>
Fri, 25 Oct 2013 14:20:58 +0000 (09:20 -0500)
Signed-off-by: Austin Seipp <austin@well-typed.com>
testsuite/tests/ghci/linking/Makefile
testsuite/tests/ghci/linking/T3333.c [new file with mode: 0644]
testsuite/tests/ghci/linking/T3333.hs [new file with mode: 0644]
testsuite/tests/ghci/linking/T3333.stdout [new file with mode: 0644]
testsuite/tests/ghci/linking/all.T

index 2f53b6b..60cb9cb 100644 (file)
@@ -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/testsuite/tests/ghci/linking/T3333.c b/testsuite/tests/ghci/linking/T3333.c
new file mode 100644 (file)
index 0000000..92fe332
--- /dev/null
@@ -0,0 +1,4 @@
+
+int weak_test(int) __attribute__((weak));
+
+int weak_test(int x) {return x + 1;}
diff --git a/testsuite/tests/ghci/linking/T3333.hs b/testsuite/tests/ghci/linking/T3333.hs
new file mode 100644 (file)
index 0000000..82c8909
--- /dev/null
@@ -0,0 +1,5 @@
+module WeakTest where
+
+import Foreign.C.Types
+
+foreign import ccall weak_test :: CInt -> IO CInt
diff --git a/testsuite/tests/ghci/linking/T3333.stdout b/testsuite/tests/ghci/linking/T3333.stdout
new file mode 100644 (file)
index 0000000..b4de394
--- /dev/null
@@ -0,0 +1 @@
+11
index 1a793d2..38ec046 100644 (file)
@@ -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'])