Message ID | A614194ED15B4844BC4C9FB7F21FCD9270457D3D@hhmail02.hh.imgtec.org |
---|---|
State | New |
Headers | show |
Toma Tabacu <Toma.Tabacu@imgtec.com> writes: > The gcc.dg/pic-2.c and gcc.dg/pie-2.c tests are failing for MIPS targets > because __PIC__ is always set to 1 for MIPS. > > This patch makes the testsuite skip those two tests for all MIPS > targets. > > Tested with mips-mti-elf and mips-mti-linux-gnu. > > Should I have fixed this in target-supports.exp instead ? > I was worried that doing so would complicate the fpic and pie effective > target checks too much. I think the skip is OK here. I'd like to get Catherine's opinion on this though too. I don't think we should change the definition of __PIC__ for -fPIC on MIPS as multi-got solves 'most' issues. If we start trying to figure out what __PIC__ should mean on MIPS then we will get into a big mess with -mxgot as that is arguably __PIC__==2 but I expect there will be several differing opinions. Thanks, Matthew > > Regards, > Toma > > gcc/testsuite/ > > * gcc.dg/pic-2.c: Skip for MIPS. > * gcc.dg/pie-2.c: Skip for MIPS. > > diff --git a/gcc/testsuite/gcc.dg/pic-2.c b/gcc/testsuite/gcc.dg/pic-2.c > index 59ce8e2..bccec13 100644 > --- a/gcc/testsuite/gcc.dg/pic-2.c > +++ b/gcc/testsuite/gcc.dg/pic-2.c > @@ -1,6 +1,7 @@ > /* { dg-do compile } */ > /* { dg-require-effective-target fpic } */ > /* { dg-options "-fPIC" } */ > +/* { dg-skip-if "__PIC__ is always 1 for MIPS" { mips*-*-* } } */ > > #if __PIC__ != 2 > # error __PIC__ is not 2! > diff --git a/gcc/testsuite/gcc.dg/pie-2.c b/gcc/testsuite/gcc.dg/pie-2.c > index 7bdc4ac..1838745 100644 > --- a/gcc/testsuite/gcc.dg/pie-2.c > +++ b/gcc/testsuite/gcc.dg/pie-2.c > @@ -1,6 +1,7 @@ > /* { dg-do compile } */ > /* { dg-options "-fPIE" } */ > /* { dg-require-effective-target pie } */ > +/* { dg-skip-if "__PIC__ is always 1 for MIPS" { mips*-*-* } } */ > > #if __PIC__ != 2 > # error __PIC__ is not 2!
> -----Original Message----- > From: Matthew Fortune [mailto:Matthew.Fortune@imgtec.com] > Sent: Wednesday, March 15, 2017 11:37 AM > To: Moore, Catherine <Catherine_Moore@mentor.com> > Cc: Toma Tabacu <Toma.Tabacu@imgtec.com>; gcc- > patches@gcc.gnu.org > Subject: RE: [PATCH,testsuite] Skip gcc.dg/pic-2.c and gcc.dg/pie-2.c for > MIPS. > > Toma Tabacu <Toma.Tabacu@imgtec.com> writes: > > The gcc.dg/pic-2.c and gcc.dg/pie-2.c tests are failing for MIPS targets > > because __PIC__ is always set to 1 for MIPS. > > > > This patch makes the testsuite skip those two tests for all MIPS > > targets. > > > > Tested with mips-mti-elf and mips-mti-linux-gnu. > > > > Should I have fixed this in target-supports.exp instead ? > > I was worried that doing so would complicate the fpic and pie effective > > target checks too much. > > I think the skip is OK here. I'd like to get Catherine's opinion on > this though too. I don't think we should change the definition of __PIC__ > for -fPIC on MIPS as multi-got solves 'most' issues. If we start trying to > figure out what __PIC__ should mean on MIPS then we will get into a big > mess with -mxgot as that is arguably __PIC__==2 but I expect there will > be several differing opinions. > I think the skip is the right way to go as well. The patch is OK with me. Catherine
> > From: Matthew Fortune > > > > I think the skip is OK here. I'd like to get Catherine's opinion on > > this though too. I don't think we should change the definition of __PIC__ > > for -fPIC on MIPS as multi-got solves 'most' issues. If we start trying to > > figure out what __PIC__ should mean on MIPS then we will get into a big > > mess with -mxgot as that is arguably __PIC__==2 but I expect there will > > be several differing opinions. > > > From: Catherine Moore > > I think the skip is the right way to go as well. The patch is OK with me. > Catherine > Committed as r246311. Thanks, Toma
diff --git a/gcc/testsuite/gcc.dg/pic-2.c b/gcc/testsuite/gcc.dg/pic-2.c index 59ce8e2..bccec13 100644 --- a/gcc/testsuite/gcc.dg/pic-2.c +++ b/gcc/testsuite/gcc.dg/pic-2.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-require-effective-target fpic } */ /* { dg-options "-fPIC" } */ +/* { dg-skip-if "__PIC__ is always 1 for MIPS" { mips*-*-* } } */ #if __PIC__ != 2 # error __PIC__ is not 2! diff --git a/gcc/testsuite/gcc.dg/pie-2.c b/gcc/testsuite/gcc.dg/pie-2.c index 7bdc4ac..1838745 100644 --- a/gcc/testsuite/gcc.dg/pie-2.c +++ b/gcc/testsuite/gcc.dg/pie-2.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-options "-fPIE" } */ /* { dg-require-effective-target pie } */ +/* { dg-skip-if "__PIC__ is always 1 for MIPS" { mips*-*-* } } */ #if __PIC__ != 2 # error __PIC__ is not 2!