]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
testsuite: Fix up pr107541.c test
authorJakub Jelinek <jakub@redhat.com>
Wed, 9 Nov 2022 10:37:58 +0000 (11:37 +0100)
committerJakub Jelinek <jakub@redhat.com>
Wed, 9 Nov 2022 10:37:58 +0000 (11:37 +0100)
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.

gcc/testsuite/gcc.dg/tree-ssa/pr107541.c

index 475142186b50028ac6e2cd7d91ac0e6a6bf72810..9c89db57aad0e1d52ce2e6628a385620091fa429 100644 (file)
@@ -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;