]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
testsuite: Add -fno-short-enums to pr97315-1.C
authorTorbjörn SVENSSON <torbjorn.svensson@foss.st.com>
Fri, 16 Aug 2024 14:10:01 +0000 (16:10 +0200)
committerTorbjörn SVENSSON <torbjorn.svensson@foss.st.com>
Fri, 16 Aug 2024 14:41:04 +0000 (16:41 +0200)
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 <torbjorn.svensson@foss.st.com>
gcc/testsuite/g++.dg/opt/pr97315-1.C

index 5a618d8e1e8c1fa9d114a0496beee4eaaeab9bf8..3e439c5f17949662f3a8da6519a6565232ab9399 100644 (file)
@@ -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 };