aboutsummaryrefslogtreecommitdiff
path: root/ld/testsuite/ld-pie/weakundef-data.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2006-02-20 20:11:00 +0000
committerH.J. Lu <hjl.tools@gmail.com>2006-02-20 20:11:00 +0000
commit72aa65a751ee21d0af8249b939f0e6cceb7afc87 (patch)
tree5eb7849e10ef41fca1c1b16c86f06113958c3ef6 /ld/testsuite/ld-pie/weakundef-data.c
parent17fbb0bdc7f49801a09bffc483ccd1fd5ab21403 (diff)
downloadgdb-72aa65a751ee21d0af8249b939f0e6cceb7afc87.zip
gdb-72aa65a751ee21d0af8249b939f0e6cceb7afc87.tar.gz
gdb-72aa65a751ee21d0af8249b939f0e6cceb7afc87.tar.bz2
2006-02-20 H.J. Lu <hongjiu.lu@intel.com>
PR ld/2218 * ld-pie/pie.exp: Add the weak undefined data test. * ld-pie/weakundef-data.c: New file.
Diffstat (limited to 'ld/testsuite/ld-pie/weakundef-data.c')
-rw-r--r--ld/testsuite/ld-pie/weakundef-data.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/ld/testsuite/ld-pie/weakundef-data.c b/ld/testsuite/ld-pie/weakundef-data.c
new file mode 100644
index 0000000..0d0f162
--- /dev/null
+++ b/ld/testsuite/ld-pie/weakundef-data.c
@@ -0,0 +1,15 @@
+#include <stdio.h>
+
+#pragma weak undef_data
+
+extern int undef_data (void);
+int (*ptr_to_data)(void) = undef_data;
+
+int
+main (void)
+{
+ if (ptr_to_data == NULL)
+ printf ("PASSED\n");
+
+ return 0;
+}