public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-3847] testsuite: Fix up pr107541.c test
@ 2022-11-09 10:38 Jakub Jelinek
0 siblings, 0 replies; only message in thread
From: Jakub Jelinek @ 2022-11-09 10:38 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:cecc039fbb4ffdb0e5185fdd7f8f87c3eec68832
commit r13-3847-gcecc039fbb4ffdb0e5185fdd7f8f87c3eec68832
Author: Jakub Jelinek <jakub@redhat.com>
Date: Wed Nov 9 11:37:58 2022 +0100
testsuite: Fix up pr107541.c test
The test fails when long is 32-bit rather than 64-bit (say x86_64 with
RUNTESTFLAGS='--target_board=unix\{-m32,-m64\} tree-ssa.exp=pr107541.c'
).
I've tweaked it to use long long so it passes even on the 32-bit
targets, and added an early out for weirdo targets because I think
the test assumes the usual 1/2/4/8 bytes sizes for char/short/int/long long.
2022-11-09 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/107541
* gcc.dg/tree-ssa/pr107541.c (c): Use long long type rather than long.
(main): Punt if sizeof short isn't 2, or int 4, or long long 8.
Diff:
---
gcc/testsuite/gcc.dg/tree-ssa/pr107541.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr107541.c b/gcc/testsuite/gcc.dg/tree-ssa/pr107541.c
index 475142186b5..9c89db57aad 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/pr107541.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr107541.c
@@ -3,9 +3,11 @@
unsigned char a = 1;
char b, e;
-long c;
+long long c;
short d;
int main() {
+ if (sizeof (short) != 2 || sizeof (int) != 4 || sizeof (long long) != 8)
+ return 0;
a = ~(1 && a);
c = ~((~a / 8 | -2) & 11007578330939886389LLU);
e = -c;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-11-09 10:38 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-09 10:38 [gcc r13-3847] testsuite: Fix up pr107541.c test Jakub Jelinek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).