diff options
author | Simon Marlow <marlowsd@gmail.com> | 2012-04-30 12:26:49 +0100 |
---|---|---|
committer | Simon Marlow <marlowsd@gmail.com> | 2012-05-01 09:05:14 +0100 |
commit | 782b5bf763fb9a913cead9653c0ddf406b58102e (patch) | |
tree | 0b68e029cb2891273d0870c7f12b99a93b75ba98 /testsuite/tests/ffi | |
parent | 8e6b90212a6ee2e9112160db1dec985610204a12 (diff) | |
download | haskell-782b5bf763fb9a913cead9653c0ddf406b58102e.tar.gz |
Fix capi_value on Windows
This appears to be a bug in the gcc that we're currently using.
Compiling this, with -O:
const int i;
int f(void) {return i;}
results in this assembly:
pushl %ebp
movl %esp, %ebp
movl $0, %eax <--- the $0 is wrong, should be _i
leave
ret
Turning off -O makes it work.
Maybe time to update our mingw gcc bundles?
Diffstat (limited to 'testsuite/tests/ffi')
-rw-r--r-- | testsuite/tests/ffi/should_run/capi_value_c.c | 2 | ||||
-rw-r--r-- | testsuite/tests/ffi/should_run/capi_value_c.h | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/testsuite/tests/ffi/should_run/capi_value_c.c b/testsuite/tests/ffi/should_run/capi_value_c.c index 45db07c6a0..5d37a7fcc2 100644 --- a/testsuite/tests/ffi/should_run/capi_value_c.c +++ b/testsuite/tests/ffi/should_run/capi_value_c.c @@ -1,4 +1,4 @@ #include "capi_value_c.h" -const int i = 23; +int i = 23; diff --git a/testsuite/tests/ffi/should_run/capi_value_c.h b/testsuite/tests/ffi/should_run/capi_value_c.h index d8ef814216..cec1863e99 100644 --- a/testsuite/tests/ffi/should_run/capi_value_c.h +++ b/testsuite/tests/ffi/should_run/capi_value_c.h @@ -1,3 +1,3 @@ -const int i; +extern int i; #define j 24 |