From a10f9a2eaaeb9acb9ffa89fa12e248745f7fce86 Mon Sep 17 00:00:00 2001 From: Martin Sebor Date: Thu, 25 May 2017 16:51:24 +0000 Subject: [PATCH] overflow-warn-9.c: Adjust expected warnings to avoid false positives on ILP32. gcc/testsuite/ChangeLog: * gcc.dg/overflow-warn-9.c: Adjust expected warnings to avoid false positives on ILP32. * gcc.dg/pr59963-2.c: Replace tabs with spaces, adjust expected column numbers. * gcc.dg/pr60114.c: Same. From-SVN: r248464 --- gcc/testsuite/ChangeLog | 8 ++++++++ gcc/testsuite/gcc.dg/overflow-warn-9.c | 7 ++++--- gcc/testsuite/gcc.dg/pr59963-2.c | 20 ++++++++++---------- gcc/testsuite/gcc.dg/pr60114.c | 14 +++++++------- 4 files changed, 29 insertions(+), 20 deletions(-) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index b2d55fa5251..55a3c6add68 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,11 @@ +2017-05-25 Martin Sebor + + * gcc.dg/overflow-warn-9.c: Adjust expected warnings to avoid false + positives on ILP32. + * gcc.dg/pr59963-2.c: Replace tabs with spaces, adjust expected + column numbers. + * gcc.dg/pr60114.c: Same. + 2017-05-23 Jan Hubicka * gfortran.dg/pr48636.f90: Fix template better. diff --git a/gcc/testsuite/gcc.dg/overflow-warn-9.c b/gcc/testsuite/gcc.dg/overflow-warn-9.c index 88d6afb5955..3c41d976688 100644 --- a/gcc/testsuite/gcc.dg/overflow-warn-9.c +++ b/gcc/testsuite/gcc.dg/overflow-warn-9.c @@ -56,9 +56,10 @@ const struct Types t1 = { .us = USHRT_MAX + 1, /* { dg-warning "unsigned conversion from .int. to .short unsigned int. changes value from .65536. to .0." } */ .si = INT_MAX + 1LU, /* { dg-warning "signed conversion from 'long unsigned int. to 'int' changes value from .2147483648. to .-2147483648." } */ - .ui = UINT_MAX + 1L, /* { dg-warning "signed conversion from .long int. to .unsigned int. changes value from .4294967296. to .0." } */ - .ui = UINT_MAX + 1LU, /* { dg-warning "conversion from .long unsigned int. to .unsigned int. changes value from .4294967296. to .0." } */ + .ui = UINT_MAX + 1L, /* { dg-warning "signed conversion from .long int. to .unsigned int. changes value from .4294967296. to .0." "lp64" { target lp64 } } */ + .ui = UINT_MAX + 1LU, /* { dg-warning "conversion from .long unsigned int. to .unsigned int. changes value from .4294967296. to .0." "lp64" { target lp64 } } */ - .sl = LONG_MAX + 1LU, /* { dg-warning "signed conversion from .long unsigned int. to .long int. changes value from .9223372036854775808. to .-9223372036854775808." } */ + .sl = LONG_MAX + 1LU, /* { dg-warning "signed conversion from .long unsigned int. to .long int. changes value from .9223372036854775808. to .-9223372036854775808." "lp64" { target lp64 } } */ + /* { dg-warning "signed conversion from .long unsigned int. to .long int. changes value from .2147483648. to .-2147483648." "ilp32" { target ilp32 } .-1 } */ .ul = ULONG_MAX + 1LU /* there should be some warning here */ }; diff --git a/gcc/testsuite/gcc.dg/pr59963-2.c b/gcc/testsuite/gcc.dg/pr59963-2.c index 1c79397317e..efd86b02170 100644 --- a/gcc/testsuite/gcc.dg/pr59963-2.c +++ b/gcc/testsuite/gcc.dg/pr59963-2.c @@ -13,9 +13,9 @@ int g (void) { return f (0xffffffffL, /* { dg-warning "13:-Woverflow" } */ - 0xffffffffL) /* { dg-warning "13:-Woverflow" } */ - && f (0xffffffffL, /* { dg-warning "9:-Woverflow" } */ - 0xffffffffL); /* { dg-warning "9:-Woverflow" } */ + 0xffffffffL) /* { dg-warning "13:-Woverflow" } */ + && f (0xffffffffL, /* { dg-warning "16:-Woverflow" } */ + 0xffffffffL); /* { dg-warning "16:-Woverflow" } */ } void @@ -24,13 +24,13 @@ foo (int i) bar (256); /* { dg-warning "8:-Woverflow" } */ bar (6.66f); /* { dg-warning "8:conversion" } */ bar8 (-1, /* { dg-warning "9:-Wsign-conversion" } */ - -2, /* { dg-warning "3:-Wsign-conversion" } */ - -3, /* { dg-warning "4:-Wsign-conversion" } */ - -4, /* { dg-warning "5:-Wsign-conversion" } */ - -5, /* { dg-warning "6:-Wsign-conversion" } */ - -6, /* { dg-warning "7:-Wsign-conversion" } */ - -7, /* { dg-warning "8:-Wsign-conversion" } */ - -8); /* { dg-warning "9:-Wsign-conversion" } */ + -2, /* { dg-warning "10:-Wsign-conversion" } */ + -3, /* { dg-warning "11:-Wsign-conversion" } */ + -4, /* { dg-warning "12:-Wsign-conversion" } */ + -5, /* { dg-warning "13:-Wsign-conversion" } */ + -6, /* { dg-warning "14:-Wsign-conversion" } */ + -7, /* { dg-warning "15:-Wsign-conversion" } */ + -8); /* { dg-warning "16:-Wsign-conversion" } */ bazu (i, i); /* { dg-warning "9:conversion" } */ bazi (0x8, 0x80000000); /* { dg-warning "14:-Wsign-conversion" "" { xfail int16 } } */ } diff --git a/gcc/testsuite/gcc.dg/pr60114.c b/gcc/testsuite/gcc.dg/pr60114.c index 0ddbe58a277..47845c16913 100644 --- a/gcc/testsuite/gcc.dg/pr60114.c +++ b/gcc/testsuite/gcc.dg/pr60114.c @@ -5,13 +5,13 @@ struct S { int n, u[2]; }; const signed char z[] = { - [0] = 0x100, /* { dg-warning "9:-Woverflow" } */ - [2] = 0x101, /* { dg-warning "9:-Woverflow" } */ + [0] = 0x100, /* { dg-warning "-Woverflow" } */ + [2] = 0x101, /* { dg-warning "-Woverflow" } */ }; int A[] = { - 0, 0x80000000, /* { dg-warning "16:-Wsign-conversion" } */ - 0xA, 0x80000000, /* { dg-warning "18:-Wsign-conversion" } */ - 0xA, 0xA, 0x80000000 /* { dg-warning "23:-Wsign-conversion" } */ + 0, 0x80000000, /* { dg-warning "16:-Wsign-conversion" } */ + 0xA, 0x80000000, /* { dg-warning "18:-Wsign-conversion" } */ + 0xA, 0xA, 0x80000000 /* { dg-warning "23:-Wsign-conversion" } */ }; int *p = (int []) { 0x80000000 }; /* { dg-warning "21:-Wsign-conversion" } */ union { int k; } u = { .k = 0x80000000 }; /* { dg-warning "29:-Wsign-conversion" } */ @@ -20,8 +20,8 @@ void foo (void) { signed char a[][3] = { { 0x100, /* { dg-warning "28:-Woverflow" } */ - 1, 0x100 }, /* { dg-warning "24:-Woverflow" } */ - { '\0', 0x100, '\0' } /* { dg-warning "27:-Woverflow" } */ + 1, 0x100 }, /* { dg-warning "24:-Woverflow" } */ + { '\0', 0x100, '\0' } /* { dg-warning "27:-Woverflow" } */ }; (const signed char []) { 0x100 }; /* { dg-warning "28:-Woverflow" } */ (const float []) { 1e0, 1e1, 1e100 }; /* { dg-warning "32:conversion" } */ -- 2.30.2