diff options
author | Rask Ingemann Lambertsen <rask@sygehus.dk> | 2007-07-28 01:03:01 +0200 |
---|---|---|
committer | Rask Ingemann Lambertsen <rask@gcc.gnu.org> | 2007-07-27 23:03:01 +0000 |
commit | e4d38a0cc5022d54eb2b1c56eea699d6297c30fc (patch) | |
tree | 44aeb976854b276d9a212c41e47287fc8cf6425b /gcc/testsuite/gcc.dg | |
parent | dd52ecb0f6c235dc9a4e41af0dac74f00d372b63 (diff) | |
download | gcc-e4d38a0cc5022d54eb2b1c56eea699d6297c30fc.zip gcc-e4d38a0cc5022d54eb2b1c56eea699d6297c30fc.tar.gz gcc-e4d38a0cc5022d54eb2b1c56eea699d6297c30fc.tar.bz2 |
re PR testsuite/32471 (Testcases which always fail on targets where an int is 16 bits)
PR testsuite/32471
* gcc.dg/torture/pr30364-1.c (f)(main): Use INT_MAX instead of
assuming it is 0x7ffffffff.
* gcc.dg/torture/pr30364-2.c (f)(main): Likewise.
* gcc.dg/torture/pr30364-3.c (f)(main): Likewise.
From-SVN: r127005
Diffstat (limited to 'gcc/testsuite/gcc.dg')
-rw-r--r-- | gcc/testsuite/gcc.dg/torture/pr30364-1.c | 9 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/torture/pr30364-2.c | 9 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/torture/pr30364-3.c | 9 |
3 files changed, 15 insertions, 12 deletions
diff --git a/gcc/testsuite/gcc.dg/torture/pr30364-1.c b/gcc/testsuite/gcc.dg/torture/pr30364-1.c index 09506c2..64ee7e4 100644 --- a/gcc/testsuite/gcc.dg/torture/pr30364-1.c +++ b/gcc/testsuite/gcc.dg/torture/pr30364-1.c @@ -1,19 +1,20 @@ /* { dg-do run } */ +#include <limits.h> extern void abort (void); int f(int a, int b) { - if (a > 0x7FFFFFF0) return 0; - if (b > 0x7FFFFFF0) return 0; + if (a > INT_MAX - 15) return 0; + if (b > INT_MAX - 15) return 0; int c = (a - 20) + (b - 20); - return c > 0x7FFFFFF0; + return c > INT_MAX - 15; } int main() { - if (f (0x7FFFFFF0, 41) != 1) + if (f (INT_MAX - 15, 41) != 1) abort (); return 0; } diff --git a/gcc/testsuite/gcc.dg/torture/pr30364-2.c b/gcc/testsuite/gcc.dg/torture/pr30364-2.c index 20450f5..d8b678d 100644 --- a/gcc/testsuite/gcc.dg/torture/pr30364-2.c +++ b/gcc/testsuite/gcc.dg/torture/pr30364-2.c @@ -1,19 +1,20 @@ /* { dg-do run } */ +#include <limits.h> extern void abort (void); int f(unsigned int a, unsigned int b) { - if (a > 0x7FFFFFF0) return 0; - if (b > 0x7FFFFFF0) return 0; + if (a > INT_MAX - 15) return 0; + if (b > INT_MAX - 15) return 0; int c = (a - 20) + (b - 20); - return c > 0x7FFFFFF0; + return c > INT_MAX - 15; } int main() { - if (f (0x7FFFFFF0, 41) != 1) + if (f (INT_MAX - 15, 41) != 1) abort (); return 0; } diff --git a/gcc/testsuite/gcc.dg/torture/pr30364-3.c b/gcc/testsuite/gcc.dg/torture/pr30364-3.c index 4365679..ae96ba3 100644 --- a/gcc/testsuite/gcc.dg/torture/pr30364-3.c +++ b/gcc/testsuite/gcc.dg/torture/pr30364-3.c @@ -1,20 +1,21 @@ /* { dg-do run } */ /* { dg-options "-fwrapv" } */ +#include <limits.h> extern void abort (void); int f(int a, int b) { - if (a > 0x7FFFFFF0) return 0; - if (b > 0x7FFFFFF0) return 0; + if (a > INT_MAX - 15) return 0; + if (b > INT_MAX - 15) return 0; int c = (a - 20) + (b - 20); - return c > 0x7FFFFFF0; + return c > INT_MAX - 15; } int main() { - if (f (0x7FFFFFF0, 41) != 1) + if (f (INT_MAX - 15, 41) != 1) abort (); return 0; } |