add test for #1288
authorSimon Marlow <simonmar@microsoft.com>
Wed, 14 May 2008 10:03:46 +0000 (10:03 +0000)
committerSimon Marlow <simonmar@microsoft.com>
Wed, 14 May 2008 10:03:46 +0000 (10:03 +0000)
testsuite/tests/ghc-regress/ffi/should_run/1288.hs [new file with mode: 0644]
testsuite/tests/ghc-regress/ffi/should_run/1288.stdout [new file with mode: 0644]
testsuite/tests/ghc-regress/ffi/should_run/Makefile
testsuite/tests/ghc-regress/ffi/should_run/all.T

diff --git a/testsuite/tests/ghc-regress/ffi/should_run/1288.hs b/testsuite/tests/ghc-regress/ffi/should_run/1288.hs
new file mode 100644 (file)
index 0000000..8b3a8f8
--- /dev/null
@@ -0,0 +1,6 @@
+import Foreign\r
+import Foreign.C\r
+\r
+foreign import stdcall "test" ctest :: CInt -> IO ()\r
+\r
+main = ctest 3\r
diff --git a/testsuite/tests/ghc-regress/ffi/should_run/1288.stdout b/testsuite/tests/ghc-regress/ffi/should_run/1288.stdout
new file mode 100644 (file)
index 0000000..ef6be04
--- /dev/null
@@ -0,0 +1 @@
+The argument passed was 3
index 72b1609..a3ef862 100644 (file)
@@ -5,3 +5,7 @@ include $(TOP)/mk/test.mk
 ffi018_ghci_setup :
        cp ffi018_c.c ffi018_ghci_c.c
        $(TEST_HC) -c ffi018_ghci_c.c
+
+1288_ghci_setup :
+       cp 1288_c.c 1288_ghci_c.c
+       $(TEST_HC) -c 1288_ghci_c.c
index 0bdd4df..b2e6043 100644 (file)
@@ -74,11 +74,11 @@ test('ffi011', normal, compile_and_run, [''])
 # it.
 
 if config.platform == 'i386-unknown-mingw32':
-       f = normal
+       skip_if_not_windows = normal
 else:
-       f = skip
+       skip_if_not_windows = skip
 
-test('ffi012', f, compile_and_run, [''])
+test('ffi012', skip_if_not_windows, compile_and_run, [''])
 
 # Doesn't work with External Core due to __labels
 test('ffi013', expect_fail_for(['extcore','optextcore']), compile_and_run, [''])
@@ -108,3 +108,13 @@ test('ffi019', normal, compile_and_run, [''])
 
 # This one originally failed only GHCi, but doesn't hurt to test all ways.
 test('1679', normal, compile_and_run, [''])
+
+test('1288', [ skip_if_not_windows, omit_ways(['ghci']),
+               extra_clean(['1288_c.o']) ],
+             compile_and_run, ['1288_c.c'])
+test('1288', [ skip_if_not_windows, only_ways(['ghci']),
+               cmd_prefix('$MAKE --no-print-directory -C ' + getTestDir() +
+                          ' 1288_ghci_setup && '),
+               extra_clean(['1288_ghci_c.c', '1288_ghci_c.o']) ],
+             compile_and_run, ['1288_ghci_c.o'])
+