aboutsummaryrefslogtreecommitdiff
path: root/tests/tcctest.c
diff options
context:
space:
mode:
authorJoe Soroka <gits@joesoroka.com>2011-03-02 13:31:09 -0800
committerJoe Soroka <gits@joesoroka.com>2011-03-02 13:31:09 -0800
commit823f83263012524b27033e908df86b592ee1a21b (patch)
tree87ff8f4926506032b8704d8c86912e76490b38ee /tests/tcctest.c
parent684723488d09f129f0e945ba860dc477c0068305 (diff)
downloadtinycc-823f83263012524b27033e908df86b592ee1a21b.tar.gz
tinycc-823f83263012524b27033e908df86b592ee1a21b.tar.bz2
tcc: fix weak attribute handling
Diffstat (limited to 'tests/tcctest.c')
-rw-r--r--tests/tcctest.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/tcctest.c b/tests/tcctest.c
index 4c72047..5ebc7bb 100644
--- a/tests/tcctest.c
+++ b/tests/tcctest.c
@@ -2354,6 +2354,10 @@ extern int __attribute__((weak)) weak_v1;
extern int __attribute__((weak)) weak_v2;
extern int weak_v3;
+extern int (*weak_fpa)() __attribute__((weak));
+extern int __attribute__((weak)) (*weak_fpb)();
+extern __attribute__((weak)) int (*weak_fpc)();
+
void __attribute__((weak)) weak_test(void)
{
printf("weak_f1=%d\n", weak_f1 ? weak_f1() : 123);
@@ -2362,6 +2366,10 @@ void __attribute__((weak)) weak_test(void)
printf("weak_v1=%d\n",&weak_v1 ? weak_v1 : 123);
printf("weak_v2=%d\n",&weak_v2 ? weak_v2 : 123);
printf("weak_v3=%d\n",&weak_v3 ? weak_v3 : 123);
+
+ printf("weak_fpa=%d\n",&weak_fpa ? weak_fpa() : 123);
+ printf("weak_fpb=%d\n",&weak_fpb ? weak_fpb() : 123);
+ printf("weak_fpc=%d\n",&weak_fpc ? weak_fpc() : 123);
}
int __attribute__((weak)) weak_f2() { return 222; }