From patchwork Wed Mar 6 17:19:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Earnshaw X-Patchwork-Id: 86889 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E7D983857C71 for ; Wed, 6 Mar 2024 17:20:48 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by sourceware.org (Postfix) with ESMTP id BF84D3858425 for ; Wed, 6 Mar 2024 17:20:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BF84D3858425 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org BF84D3858425 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=217.140.110.172 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709745616; cv=none; b=Vfxy5enBtudEREng4T/xCxg1HwbSPHtK43AjQcgh88kHhbTnaq4LVG4ZEpwzJclPicjOsoDRI3IVQyy/QLrduL/9RJ4gxCG9enw3a9a7xvAwWL08lrhtdSTFBkGxTP+GslwVevHOPXtvVlYQadxJRgP1avluo7/n7aql96DH6Fc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709745616; c=relaxed/simple; bh=4hI2/ouEEPxCR+C08eNhphh7NO/OkN/leECdTYn6ULA=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=ts9bG694miG21KrUbcDDI6R5iX0JTwb0uVU8Tmbegi7FX3/5cD9LcCYgCmyhBwynjEdmTtMDWVOJ5uHYAW6QUnR6WQgvbIWKk0c+DcgJtXvO/WsVp4vWd7VYslzIX2ZFqFyyUizkcddG8/w7jw3Zkg3cCCkWJheFfctmo+R6xwk= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 5828C1FB; Wed, 6 Mar 2024 09:20:50 -0800 (PST) Received: from e120077-lin.cambridge.arm.com (e120077-lin.cambridge.arm.com [10.2.78.54]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 5A2553F738; Wed, 6 Mar 2024 09:20:12 -0800 (PST) From: Richard Earnshaw To: gcc-patches@gcc.gnu.org Cc: Richard Earnshaw , julian@codesourcery.com Subject: [PATCH] gomp: testsuite: improve compatibility of bad-array-section-3.c [PR113428] Date: Wed, 6 Mar 2024 17:19:44 +0000 Message-Id: <20240306171944.1894424-1-rearnsha@arm.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-13.8 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_NONE, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org This test generates different warnings on ilp32 targets because the size of an integer matches the size of a pointer. Avoid this by using signed char. gcc/testsuite: PR testsuite/113428 * gcc.dg/gomp/bad-array-section-c-3.c: Use signed char instead of int. --- I think this fixes the issues seen on ilp32 machines, without substantially changing what the test does, but a second set of eyes wouldn't hurt. gcc/testsuite/gcc.dg/gomp/bad-array-section-c-3.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gcc/testsuite/gcc.dg/gomp/bad-array-section-c-3.c b/gcc/testsuite/gcc.dg/gomp/bad-array-section-c-3.c index 8be15ced8c0..431af71c422 100644 --- a/gcc/testsuite/gcc.dg/gomp/bad-array-section-c-3.c +++ b/gcc/testsuite/gcc.dg/gomp/bad-array-section-c-3.c @@ -1,15 +1,15 @@ /* { dg-do compile } */ struct S { - int *ptr; + signed char *ptr; }; int main() { - int arr[20]; + signed char arr[20]; /* Reject array section in compound initialiser. */ -#pragma omp target map( (struct S) { .ptr = (int *) arr[5:5] } ) +#pragma omp target map( (struct S) { .ptr = (signed char *) arr[5:5] } ) /* { dg-error {expected '\]' before ':' token} "" { target *-*-* } .-1 } */ /* { dg-warning {cast to pointer from integer of different size} "" { target *-*-* } .-2 } */ /* { dg-message {sorry, unimplemented: unsupported map expression} "" { target *-*-* } .-3 } */