summaryrefslogtreecommitdiff
path: root/testsuite/tests/ffi/should_run/ffi002_c.c
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/ffi/should_run/ffi002_c.c')
-rw-r--r--testsuite/tests/ffi/should_run/ffi002_c.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/testsuite/tests/ffi/should_run/ffi002_c.c b/testsuite/tests/ffi/should_run/ffi002_c.c
new file mode 100644
index 0000000000..1e5edd2424
--- /dev/null
+++ b/testsuite/tests/ffi/should_run/ffi002_c.c
@@ -0,0 +1,21 @@
+#include <stdio.h>
+#include "ffi002_stub.h"
+
+#include "RtsAPI.h"
+
+extern void __stginit_Foo ( void );
+
+int main(int argc, char *argv[])
+{
+ int i;
+
+ startupHaskell(argc, argv, __stginit_Foo);
+
+ for (i = 0; i < 5; i++) {
+ printf("%d\n", foo(2500));
+ }
+
+ shutdownHaskell();
+
+ return 0;
+}