public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Patch, testsuite] Skip case struct-layout-1 for targets using short enums.
@ 2011-09-01  1:40 Terry Guo
  2011-09-01  6:14 ` Jakub Jelinek
  0 siblings, 1 reply; 7+ messages in thread
From: Terry Guo @ 2011-09-01  1:40 UTC (permalink / raw)
  To: gcc-patches; +Cc: ro, mikestump

Hello,

There are some bitfield definitions in this case, such as "enum E2 a:31".
For most targets, the ENUM type size equals INT type so this definition is
OK. But for some targets like arm_eabi, the default ENUM type size could be
the smallest integer type that can contain all of its enumerated values. For
this case, the size of variable a is 8 bits. Thus the above definition is
regarded as an error.

We could fix this issue in two methods: compile the cases with option
-fno-short-enums or just skip the case for targets with short enums. For the
first one, the user must also provide a library built with option
-fno-short-enums, otherwise linking them together could cause subtle issues.
This patch prefers the last method. If the no-short-enums library is ready,
user can still run this case by performing "make check" with extra option
-fno-short-enums.

Here is the patch, is it OK to commit?

Best regards,
Terry

2011-08-31  Terry Guo  <terry.guo@arm.com>

        * gcc.dg/compat/struct-layout-1_main.c: Skip the case
        if the target uses short enums.

diff --git a/gcc/testsuite/gcc.dg/compat/struct-layout-1_main.c
b/gcc/testsuite/gcc.dg/compat/struct-layout-1_main.c
index b59453e..64275ea 100644
--- a/gcc/testsuite/gcc.dg/compat/struct-layout-1_main.c
+++ b/gcc/testsuite/gcc.dg/compat/struct-layout-1_main.c
@@ -1,4 +1,5 @@
 /* { dg-prune-output ".*-Wno-abi.*" } */
+/* { dg-skip-if "" { short_enums } } */
  
   #include "struct-layout-1.h"


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-09-01  7:46 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-01  1:40 [Patch, testsuite] Skip case struct-layout-1 for targets using short enums Terry Guo
2011-09-01  6:14 ` Jakub Jelinek
2011-09-01  6:34   ` Terry Guo
2011-09-01  6:46     ` Jakub Jelinek
2011-09-01  7:10       ` Terry Guo
2011-09-01  7:23         ` Jakub Jelinek
2011-09-01  7:46           ` Terry Guo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).