diff options
Diffstat (limited to 'binutils-2.21/ld/testsuite/ld-elfweak/bar1a.c')
-rw-r--r-- | binutils-2.21/ld/testsuite/ld-elfweak/bar1a.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/binutils-2.21/ld/testsuite/ld-elfweak/bar1a.c b/binutils-2.21/ld/testsuite/ld-elfweak/bar1a.c new file mode 100644 index 0000000..daf0c58 --- /dev/null +++ b/binutils-2.21/ld/testsuite/ld-elfweak/bar1a.c @@ -0,0 +1,26 @@ +#include <stdio.h> + +extern int deallocate_foo; + +extern int * bar (); +extern int * foo (); +extern void abort (); +extern void foobar (); + +void +foobar () +{ + if (&deallocate_foo != bar () || &deallocate_foo != foo ()) + abort (); + + if (deallocate_foo) + printf ("weak deallocate_foo\n"); + else + printf ("strong deallocate_foo\n"); +} + +int * +bar() +{ + return &deallocate_foo; +} |