From d835608f05471e749533c756ccdd9e166b819b68 Mon Sep 17 00:00:00 2001 From: Marek Polacek Date: Fri, 23 Oct 2020 19:26:43 -0400 Subject: [PATCH] testsuite: Fix -Wsizeof-array-div tests. gcc/testsuite/ChangeLog: * c-c++-common/Wsizeof-array-div1.c: Expect certain warnings on lp64 targets only. * g++.dg/warn/Wsizeof-array-div2.C: Only run on lp64 targets. --- gcc/testsuite/c-c++-common/Wsizeof-array-div1.c | 6 +++--- gcc/testsuite/g++.dg/warn/Wsizeof-array-div2.C | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/gcc/testsuite/c-c++-common/Wsizeof-array-div1.c b/gcc/testsuite/c-c++-common/Wsizeof-array-div1.c index 84d9a730cba..6e01d6c87d1 100644 --- a/gcc/testsuite/c-c++-common/Wsizeof-array-div1.c +++ b/gcc/testsuite/c-c++-common/Wsizeof-array-div1.c @@ -13,12 +13,12 @@ fn (int ap[]) int r = 0; r += sizeof (arr) / sizeof (*arr); - r += sizeof (arr) / sizeof (p); /* { dg-warning "expression does not compute" } */ - r += sizeof (arr) / sizeof p; /* { dg-warning "expression does not compute" } */ + r += sizeof (arr) / sizeof (p); /* { dg-warning "expression does not compute" "" { target { lp64 } } } */ + r += sizeof (arr) / sizeof p; /* { dg-warning "expression does not compute" "" { target { lp64 } } } */ r += sizeof (arr) / (sizeof p); r += sizeof (arr) / (sizeof (p)); r += sizeof (arr2) / sizeof p; - r += sizeof (arr2) / sizeof (int); /* { dg-warning "expression does not compute" } */ + r += sizeof (arr2) / sizeof (int); /* { dg-warning "expression does not compute" "" { target { lp64 } } } */ r += sizeof (arr2) / sizeof (int *); r += sizeof (arr2) / sizeof (short *); r += sizeof (arr) / sizeof (int); diff --git a/gcc/testsuite/g++.dg/warn/Wsizeof-array-div2.C b/gcc/testsuite/g++.dg/warn/Wsizeof-array-div2.C index 7962c23522c..66fe72ab6c9 100644 --- a/gcc/testsuite/g++.dg/warn/Wsizeof-array-div2.C +++ b/gcc/testsuite/g++.dg/warn/Wsizeof-array-div2.C @@ -1,5 +1,5 @@ // PR c++/91741 -// { dg-do compile } +// { dg-do compile { target { lp64 } } } // { dg-options "-Wall" } // From . -- 2.30.2