aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-elfweak/main1.c
diff options
context:
space:
mode:
Diffstat (limited to 'ld/testsuite/ld-elfweak/main1.c')
-rw-r--r--ld/testsuite/ld-elfweak/main1.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/ld/testsuite/ld-elfweak/main1.c b/ld/testsuite/ld-elfweak/main1.c
new file mode 100644
index 0000000..8a897a2
--- /dev/null
+++ b/ld/testsuite/ld-elfweak/main1.c
@@ -0,0 +1,22 @@
+#include <stdio.h>
+
+#pragma weak deallocate_foo
+int deallocate_foo = 1;
+
+extern int * bar ();
+extern int * foo ();
+extern void abort ();
+
+int
+main ()
+{
+ if (&deallocate_foo != bar () || &deallocate_foo != foo ())
+ abort ();
+
+ if (deallocate_foo)
+ printf ("weak deallocate_foo\n");
+ else
+ printf ("strong deallocate_foo\n");
+
+ return 0;
+}