diff options
| author | Joe Soroka <gits@joesoroka.com> | 2011-02-01 09:41:03 -0800 |
|---|---|---|
| committer | Joe Soroka <gits@joesoroka.com> | 2011-02-01 09:41:03 -0800 |
| commit | cf08675702044c180553c866ba1fde0414f00590 (patch) | |
| tree | 8f9938bcc18b868912f173bcd4f6c125da1e2548 /tests/tcctest.c | |
| parent | c59d3426b8060bcba3945f1388763512412a5d4d (diff) | |
| download | tinycc-cf08675702044c180553c866ba1fde0414f00590.tar.gz tinycc-cf08675702044c180553c866ba1fde0414f00590.tar.bz2 | |
weak definitions overrule non-weak prototypes
Diffstat (limited to 'tests/tcctest.c')
| -rw-r--r-- | tests/tcctest.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/tcctest.c b/tests/tcctest.c index 8c2b2a2..0128957 100644 --- a/tests/tcctest.c +++ b/tests/tcctest.c @@ -2231,19 +2231,25 @@ void builtin_test(void) extern int __attribute__((weak)) weak_f1(void); extern int __attribute__((weak)) weak_f2(void); +extern int weak_f3(void); extern int __attribute__((weak)) weak_v1; extern int __attribute__((weak)) weak_v2; +extern int weak_v3; void __attribute__((weak)) weak_test(void) { printf("weak_f1=%d\n", weak_f1 ? weak_f1() : 123); printf("weak_f2=%d\n", weak_f2 ? weak_f2() : 123); + printf("weak_f3=%d\n", weak_f3 ? weak_f3() : 123); 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); } int __attribute__((weak)) weak_f2() { return 222; } +int __attribute__((weak)) weak_f3() { return 333; } int __attribute__((weak)) weak_v2 = 222; +int __attribute__((weak)) weak_v3 = 333; void const_func(const int a) { |
