On 12/11/2024 17:30, Martin Uecker wrote: > > I added a max element as suggested by Richard to force > the type to an int. > > Regression tested on x86_64 but needs testing on arm-eabi. > > Thiago, could you test this? > > https://linaro.atlassian.net/browse/GNU-1224 > > > Fix test failures for enum-alias-{1,2,3} on arm-eabi [PR117419] > > The tests added for PR115157 fail on arm-eabi. Add __INT_MAX__ > to enum to make sure they have size int. > > PR testsuite/117419 > > gcc/testsuite/ChangeLog: > * enum-alias-1.c: Add __INT_MAX__. > * enum-alias-2.c: Likewise. > * enum-alias-3.c: Likewise. > > diff --git a/gcc/testsuite/gcc.dg/enum-alias-1.c > b/gcc/testsuite/gcc.dg/enum-alias-1.c > index 8fa30eb7897..a91eb666ac2 100644 > --- a/gcc/testsuite/gcc.dg/enum-alias-1.c > +++ b/gcc/testsuite/gcc.dg/enum-alias-1.c > @@ -1,7 +1,7 @@ > /* { dg-do run } */ > /* { dg-options "-O2" } */ > > -enum E { E1 = -1, E2 = 0, E3 = 1 }; > +enum E { E1 = -1, E2 = 0, E3 = 1, MAX = __INT_MAX__ }; > > typedef int A; > typedef enum E B; > diff --git a/gcc/testsuite/gcc.dg/enum-alias-2.c > b/gcc/testsuite/gcc.dg/enum-alias-2.c > index 7ca3f3b2db8..f107968435c 100644 > --- a/gcc/testsuite/gcc.dg/enum-alias-2.c > +++ b/gcc/testsuite/gcc.dg/enum-alias-2.c > @@ -9,7 +9,7 @@ void* foo(void* a, void *b, void *c, void *d) > > { > typedef enum E B; > - enum E { E1 = -1, E2 = 0, E3 = 1 }; > + enum E { E1 = -1, E2 = 0, E3 = 1, MAX = __INT_MAX__ }; > *(B**)b = d; > } > > diff --git a/gcc/testsuite/gcc.dg/enum-alias-3.c > b/gcc/testsuite/gcc.dg/enum-alias-3.c > index 322c8d82952..fd226a41408 100644 > --- a/gcc/testsuite/gcc.dg/enum-alias-3.c > +++ b/gcc/testsuite/gcc.dg/enum-alias-3.c > @@ -9,7 +9,7 @@ void* foo(void* a, void *b, void *c, void *d) > *(A**)a = c; > > typedef enum E *B; > - enum E { E1 = -1, E2 = 0, E3 = 1 }; > + enum E { E1 = -1, E2 = 0, E3 = 1, MAX = __INT_MAX__ }; > { > *(B**)b = d; > } >
OK. R.