From: Torbjörn SVENSSON Date: Fri, 16 Aug 2024 14:10:01 +0000 (+0200) Subject: testsuite: Add -fno-short-enums to pr97315-1.C X-Git-Tag: basepoints/gcc-16~6602 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=10bf0357750972e20dc702997f2930eab1c1be17;p=thirdparty%2Fgcc.git testsuite: Add -fno-short-enums to pr97315-1.C The test case assumes that sizeof(tree_code) >= 2. On some targets, like Cortex-M on arm-none-eabi, -fshort-enums is enabled by default and in that case, sizeof(tree_code) will be 1 and the following warning is emitted: .../pr97315-1.C:8:13: warning: width of 'tree_base::code' exceeds its type Avoid the warning by forcing -fno-short-enums. gcc/testsuite/ChangeLog: * g++.dg/opt/pr97315-1.C: Add -fno-short-enums. Signed-off-by: Torbjörn SVENSSON --- diff --git a/gcc/testsuite/g++.dg/opt/pr97315-1.C b/gcc/testsuite/g++.dg/opt/pr97315-1.C index 5a618d8e1e8..3e439c5f179 100644 --- a/gcc/testsuite/g++.dg/opt/pr97315-1.C +++ b/gcc/testsuite/g++.dg/opt/pr97315-1.C @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O3 -fno-exceptions" } */ +/* { dg-options "-O3 -fno-exceptions -fno-short-enums" } */ typedef struct tree_node *tree; enum tree_code { RECORD_TYPE, QUAL_UNION_TYPE };