From 792ae36d0f768990b864d55a8a74fb92542ded0e Mon Sep 17 00:00:00 2001 From: "Kaveh R. Ghazi" Date: Tue, 5 Sep 2000 15:52:44 +0000 Subject: [PATCH] * gcc.dg/wtr-int-type-1.c: Fix for 64-bit platforms. From-SVN: r36160 --- gcc/testsuite/ChangeLog | 4 ++++ gcc/testsuite/gcc.dg/wtr-int-type-1.c | 29 +++++++++++++++++++++++++---- 2 files changed, 29 insertions(+), 4 deletions(-) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ce77b3e..f5ca385 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2000-09-05 Kaveh R. Ghazi + + * gcc.dg/wtr-int-type-1.c: Fix for 64-bit platforms. + 2000-09-04 Nathan Sidwell * g++.old-deja/g++.pt/crash57.C: New test. diff --git a/gcc/testsuite/gcc.dg/wtr-int-type-1.c b/gcc/testsuite/gcc.dg/wtr-int-type-1.c index 27ab144..c755f83 100644 --- a/gcc/testsuite/gcc.dg/wtr-int-type-1.c +++ b/gcc/testsuite/gcc.dg/wtr-int-type-1.c @@ -9,16 +9,37 @@ testfunc (void) { long long i; + /* Octal and hex values shouldn't issue -Wtraditional warnings. */ i = 0x80000000; + i = 0xFFFFFFFF; + i = 037777777777; + i = 0x8000000000000000; - i = 9223372036854775807; /* { dg-warning "integer constant.*with -traditional" "integer constant" } */ - i = 4294967295; /* { dg-warning "decimal constant|integer constant.*with -traditional" "integer constant" } */ + i = 0xFFFFFFFFFFFFFFFF; + i = 01777777777777777777777; + + /* We expect to get either a "width of integer constant changes with + -traditional" warning or an "integer constant is unsigned in ISO + C, signed with -traditional" warning depending on whether we are + testing on a 32 or 64 bit platform. Either warning means the + test passes and both matched by checking for "integer constant". */ + i = 18446744073709551615; /* { dg-warning "integer constant" "integer constant" } */ -#line 18 "sys-header.h" 3 +#line 29 "sys-header.h" 3 /* We are in system headers now, no -Wtraditional warnings should issue. */ i = 0x80000000; + i = 0xFFFFFFFF; + i = 037777777777; + i = 0x8000000000000000; + i = 0xFFFFFFFFFFFFFFFF; + i = 01777777777777777777777; + i = 9223372036854775807; - i = 4294967295; /* { dg-warning "decimal constant" "decimal constant" } */ + i = 18446744073709551615; } + +/* Ignore "decimal constant is so large that it is unsigned" warnings. */ +/* { dg-warning "decimal constant" "decimal constant" { target *-*-* } 26 } */ +/* { dg-warning "decimal constant" "decimal constant" { target *-*-* } 40 } */ -- 2.7.4