This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Fix short enums testcases on ARM GNU/Linux + EABI


This patch, which has been kicking around our local source tree in one
form or another for a year, fixes a few FAILs and ERRORs in the
testsuite on arm-none-linux-gnueabi.

There are three linker "intervals" to consider.  First ld supported
EABI but didn't check enum attributes so the tests passed.  Then it
did, and had no option to suppress the check, so they started failing.
Then the option was added, on 2007-03-18.

At the time no one had an installed linker which would work with the
option.  We would have had to probe for it in the test harness.
Doable but no one ever did it.  Now the option is in the last linker
release and I think it's reasonable to expect people to upgrade if
they want 100% clean testsuite results.

Accordingly - OK to commit for trunk?

-- 
Daniel Jacobowitz
CodeSourcery

2008-04-23  Mark Shinwell  <shinwell@codesourcery.com>
	    Daniel Jacobowitz  <dan@codesourcery.com>
	    Andrew Jenner  <andrew@codesourcery.com>

	* g++.old-deja/g++.jason/enum6.C, g++.old-deja/g++.law/enum9.C,
	g++.old-deja/g++.other/enum4.C, gfortran/enum_9.f90,
	gfortran.dg/enum_10.f90: Broaden dg-options pattern.

Index: gcc/testsuite/g++.old-deja/g++.jason/enum6.C
===================================================================
--- gcc/testsuite/g++.old-deja/g++.jason/enum6.C	(.../mirrors/gcc/trunk/gcc/testsuite/g++.old-deja/g++.jason/enum6.C)	(revision 205485)
+++ gcc/testsuite/g++.old-deja/g++.jason/enum6.C	(.../csl/gcc/branches/sourcerygxx-4_2/gcc/testsuite/g++.old-deja/g++.jason/enum6.C)	(revision 205485)
@@ -1,6 +1,17 @@
 // { dg-do run  }
 // { dg-options "-fshort-enums" }
 
+// On ARM EABI targets this testcase will cause a warning to be emitted
+// whilst EABI attributes are being merged at link time unless
+// the --no-enum-size-warning option is passed to the linker.  Whilst the
+// enum-size attributes should only be emitted if there are values of
+// enum type that can escape the compilation unit, gcc cannot currently
+// detect this; if this facility is added then this linker option should
+// not be needed.  arm-*-linux*eabi should be a good approximation to
+// those platforms where the EABI supplement defines enum values to be
+// 32 bits wide.
+// { dg-options "-fshort-enums -Wl,--no-enum-size-warning" { target arm*-*-linux*eabi } }
+
 #include <limits.h>
 
 enum A { a1 = 0x7fffffff };
Index: gcc/testsuite/g++.old-deja/g++.law/enum9.C
===================================================================
--- gcc/testsuite/g++.old-deja/g++.law/enum9.C	(.../mirrors/gcc/trunk/gcc/testsuite/g++.old-deja/g++.law/enum9.C)	(revision 205485)
+++ gcc/testsuite/g++.old-deja/g++.law/enum9.C	(.../csl/gcc/branches/sourcerygxx-4_2/gcc/testsuite/g++.old-deja/g++.law/enum9.C)	(revision 205485)
@@ -1,5 +1,17 @@
 // { dg-do run  }
 // { dg-options "-fshort-enums" }
+
+// On ARM EABI targets this testcase will cause a warning to be emitted
+// whilst EABI attributes are being merged at link time unless
+// the --no-enum-size-warning option is passed to the linker.  Whilst the
+// enum-size attributes should only be emitted if there are values of
+// enum type that can escape the compilation unit, gcc cannot currently
+// detect this; if this facility is added then this linker option should
+// not be needed.  arm-*-linux*eabi should be a good approximation to
+// those platforms where the EABI supplement defines enum values to be
+// 32 bits wide.
+// { dg-options "-fshort-enums -Wl,--no-enum-size-warning" { target arm*-*-linux*eabi } }
+
 // GROUPS passed enums
   extern "C" int printf (const char *, ...);
 
Index: gcc/testsuite/g++.old-deja/g++.other/enum4.C
===================================================================
--- gcc/testsuite/g++.old-deja/g++.other/enum4.C	(.../mirrors/gcc/trunk/gcc/testsuite/g++.old-deja/g++.other/enum4.C)	(revision 205485)
+++ gcc/testsuite/g++.old-deja/g++.other/enum4.C	(.../csl/gcc/branches/sourcerygxx-4_2/gcc/testsuite/g++.old-deja/g++.other/enum4.C)	(revision 205485)
@@ -1,7 +1,19 @@
 // { dg-do run  }
 // { dg-options "-fshort-enums" }
+
 // Origin: Mark Mitchell <mark@codesourcery.com>
 
+// On ARM EABI targets this testcase will cause a warning to be emitted
+// whilst EABI attributes are being merged at link time unless
+// the --no-enum-size-warning option is passed to the linker.  Whilst the
+// enum-size attributes should only be emitted if there are values of
+// enum type that can escape the compilation unit, gcc cannot currently
+// detect this; if this facility is added then this linker option should
+// not be needed.  arm-*-linux*eabi should be a good approximation to
+// those platforms where the EABI supplement defines enum values to be
+// 32 bits wide.
+// { dg-options "-fshort-enums -Wl,--no-enum-size-warning" { target arm*-*-linux*eabi } }
+
 enum E { 
   a = -312
 };
Index: gcc/testsuite/gfortran.dg/enum_10.f90
===================================================================
--- gcc/testsuite/gfortran.dg/enum_10.f90	(.../mirrors/gcc/trunk/gcc/testsuite/gfortran.dg/enum_10.f90)	(revision 205485)
+++ gcc/testsuite/gfortran.dg/enum_10.f90	(.../csl/gcc/branches/sourcerygxx-4_2/gcc/testsuite/gfortran.dg/enum_10.f90)	(revision 205485)
@@ -1,6 +1,7 @@
 ! { dg-do run }
 ! { dg-additional-sources enum_10.c }
 ! { dg-options "-fshort-enums -w" }
+! { dg-options "-fshort-enums -w -Wl,--no-enum-size-warning" { target arm*-*-linux*eabi } }
 ! Make sure short enums are indeed interoperable with the
 ! corresponding C type.
 
Index: gcc/testsuite/gfortran.dg/enum_9.f90
===================================================================
--- gcc/testsuite/gfortran.dg/enum_9.f90	(revision 134599)
+++ gcc/testsuite/gfortran.dg/enum_9.f90	(working copy)
@@ -1,5 +1,6 @@
 ! { dg-do run }
 ! { dg-options "-fshort-enums" }
+! { dg-options "-fshort-enums -Wl,--no-enum-size-warning" { target arm*-*-linux*eabi } }
 ! Program to test enumerations when option -fshort-enums is given
 
 program main


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]