aboutsummaryrefslogtreecommitdiff
path: root/ld
diff options
context:
space:
mode:
authornobody <>2011-10-08 16:51:12 +0000
committernobody <>2011-10-08 16:51:12 +0000
commita8317aa2e63fe821a1dd1ed829c4653369e3381d (patch)
treec2b2cef1f1ce11a52cfe8c5d397214ed8e64e9ac /ld
parent82166f2aff88943047b0259f0589f93c712abf2b (diff)
downloadgdb-a8317aa2e63fe821a1dd1ed829c4653369e3381d.zip
gdb-a8317aa2e63fe821a1dd1ed829c4653369e3381d.tar.gz
gdb-a8317aa2e63fe821a1dd1ed829c4653369e3381d.tar.bz2
This commit was manufactured by cvs2svn to create branch 'binutils-
2_22-branch'. Cherrypick from master 2011-10-08 16:51:11 UTC H.J. Lu <hjl.tools@gmail.com> 'Preserve the maximum alignment/size for common symbols.': ld/testsuite/ld-elf/pr13250-1.c ld/testsuite/ld-elf/pr13250-2.c ld/testsuite/ld-elf/pr13250-3.c
Diffstat (limited to 'ld')
-rw-r--r--ld/testsuite/ld-elf/pr13250-1.c8
-rw-r--r--ld/testsuite/ld-elf/pr13250-2.c10
-rw-r--r--ld/testsuite/ld-elf/pr13250-3.c22
3 files changed, 40 insertions, 0 deletions
diff --git a/ld/testsuite/ld-elf/pr13250-1.c b/ld/testsuite/ld-elf/pr13250-1.c
new file mode 100644
index 0000000..e43ebe0
--- /dev/null
+++ b/ld/testsuite/ld-elf/pr13250-1.c
@@ -0,0 +1,8 @@
+int common1[8];
+void
+foo ()
+{
+ int i;
+ for (i = 0; i < sizeof (common1)/ sizeof (common1[0]); i++)
+ common1[i] = -1;
+}
diff --git a/ld/testsuite/ld-elf/pr13250-2.c b/ld/testsuite/ld-elf/pr13250-2.c
new file mode 100644
index 0000000..af8268b
--- /dev/null
+++ b/ld/testsuite/ld-elf/pr13250-2.c
@@ -0,0 +1,10 @@
+extern int common1[8];
+
+extern void foo ();
+
+int
+bar ()
+{
+ foo ();
+ return common1[4];
+}
diff --git a/ld/testsuite/ld-elf/pr13250-3.c b/ld/testsuite/ld-elf/pr13250-3.c
new file mode 100644
index 0000000..a227670
--- /dev/null
+++ b/ld/testsuite/ld-elf/pr13250-3.c
@@ -0,0 +1,22 @@
+#include <stdio.h>
+#include <stdlib.h>
+
+int common1[1];
+char common2[2];
+
+extern int bar ();
+
+int
+main ()
+{
+ int i;
+ if (bar () != -1)
+ abort ();
+ if (common1[0] != -1)
+ abort ();
+ for (i = 0; i < sizeof (common2)/ sizeof (common2[0]); i++)
+ if (common2[i] != 0)
+ abort ();
+ printf ("PASS\n");
+ return 0;
+}