This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Fix for gcc.dg/ppc-sdata-1.c testsuite failures
- From: "Ben Elliston" <bje at au1 dot ibm dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: amodra at bigpond dot net dot au
- Date: 15 Oct 2004 15:52:12 +1000
- Subject: Fix for gcc.dg/ppc-sdata-1.c testsuite failures
The following patch fixes the testsuite failures for the ppc-sdata-1.c
test case on powerpc-linux. According to Alan Modra, the linker now
decides which register to use to access sdata and patches the object
code accordingly. In case other PowerPC ports don't do this, I've
modified the test to accept the original register numbers, too.
Okay for mainline?
2004-10-15 Ben Elliston <bje@au.ibm.com>
* gcc.dg/ppc-sdata-1.c: Update to consider the possibility of the
compiler referring to register 0 when accessing sdata. The linker
now patches things up.
Index: ppc-sdata-1.c
===================================================================
RCS file: /home/bje/gcc-cvs/gcc/gcc/testsuite/gcc.dg/ppc-sdata-1.c,v
retrieving revision 1.1
diff -u -p -r1.1 ppc-sdata-1.c
--- ppc-sdata-1.c 10 Mar 2003 20:42:23 -0000 1.1
+++ ppc-sdata-1.c 15 Oct 2004 05:48:39 -0000
@@ -2,8 +2,8 @@
/* { dg-options "-O2 -fno-common -G 8 -meabi -msdata=eabi" } */
/* { dg-final { scan-assembler "\\.section\[ \t\]\\.sdata," } } */
/* { dg-final { scan-assembler "\\.section\[ \t\]\\.sdata2," } } */
-/* { dg-final { scan-assembler "sdat@sdarel\\(13\\)" } } */
-/* { dg-final { scan-assembler "sdat2@sda21\\(2\\)" } } */
+/* { dg-final { scan-assembler "sdat@sda21\\((13|0)\\)" } } */
+/* { dg-final { scan-assembler "sdat2@sda21\\((2|0)\\)" } } */
int sdat = 2;