]> git.ipfire.org Git - thirdparty/gcc.git/commit
testsuite: Fix up pr111309-2.c on arm [PR111309]
authorJakub Jelinek <jakub@redhat.com>
Tue, 21 Nov 2023 09:03:26 +0000 (10:03 +0100)
committerJakub Jelinek <jakub@redhat.com>
Tue, 21 Nov 2023 09:03:26 +0000 (10:03 +0100)
commit1fcfd224ff67afd08ea5aa66a8bd687bb21798b2
tree5ce134799f698d5e059a87bebe63462201779b17
parent8a8a6d60c670c5153c5109df5fe68deb6fcf466d
testsuite: Fix up pr111309-2.c on arm [PR111309]

ARM defaults to -fshort-enums and the following testcase FAILs there in 2
lines.  The difference is that in C++, E0 has enum E type, which normally
has unsigned int underlying type, so it isn't int nor something that
promotes to int, which is why we diagnose it (in C it is promoted to int).
But with -fshort-enums, the underlying type is unsigned char in that case,
which promotes to int just fine.

The following patch adjusts the expectations, such that we don't expect
it on arm or when people manually test with -fshort-enums.

2023-11-21  Jakub Jelinek  <jakub@redhat.com>

PR c/111309
* c-c++-common/pr111309-2.c (foo): Don't expect errors for C++ with
-fshort-enums if second argument is E0.
gcc/testsuite/c-c++-common/pr111309-2.c