This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[Patch, testsuite] Skip case struct-layout-1 for targets using short enums.
- From: "Terry Guo" <terry dot guo at arm dot com>
- To: <gcc-patches at gcc dot gnu dot org>
- Cc: <ro at CeBiTec dot Uni-Bielefeld dot DE>, <mikestump at comcast dot net>
- Date: Thu, 1 Sep 2011 09:34:20 +0800
- Subject: [Patch, testsuite] Skip case struct-layout-1 for targets using short enums.
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"