From patchwork Wed Jul 20 09:32:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kewen.Lin" X-Patchwork-Id: 1658446 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=iwMTaGH+; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4Lnr8M5dJjz9s2R for ; Wed, 20 Jul 2022 19:32:33 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1EC8A38582AE for ; Wed, 20 Jul 2022 09:32:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1EC8A38582AE DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1658309551; bh=BrU184u1WCLP0RIdFx+cv2T2T3mT9951CwUX3YGUpiA=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=iwMTaGH+mUc07YDuEps5og/ha9NEkDDzNi6vZTZVUuAd9Qq+Clri2YQfkdSGS36jD ps6sOGhgEDK4VQltOyLp6f6nuLPs2BAJfAV+1Ekas3WcBrAm/y4/V1tBUc6mQxHRq/ /Id102v7U/8vRpRDj2X8T13NjTB6hshWydJkwjJ8= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id 483BD3858D37 for ; Wed, 20 Jul 2022 09:32:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 483BD3858D37 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 26K9LUvt011798; Wed, 20 Jul 2022 09:32:09 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3hef0nr8f9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 20 Jul 2022 09:32:08 +0000 Received: from m0098410.ppops.net (m0098410.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 26K9MPhv013962; Wed, 20 Jul 2022 09:32:08 GMT Received: from ppma03ams.nl.ibm.com (62.31.33a9.ip4.static.sl-reverse.com [169.51.49.98]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3hef0nr8dt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 20 Jul 2022 09:32:08 +0000 Received: from pps.filterd (ppma03ams.nl.ibm.com [127.0.0.1]) by ppma03ams.nl.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 26K9Mr2b002092; Wed, 20 Jul 2022 09:32:06 GMT Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by ppma03ams.nl.ibm.com with ESMTP id 3hbmy8wd0k-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 20 Jul 2022 09:32:05 +0000 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 26K9W34u9437678 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 20 Jul 2022 09:32:03 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id AA553AE045; Wed, 20 Jul 2022 09:32:03 +0000 (GMT) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3F96CAE04D; Wed, 20 Jul 2022 09:32:02 +0000 (GMT) Received: from [9.197.246.191] (unknown [9.197.246.191]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 20 Jul 2022 09:32:01 +0000 (GMT) Message-ID: <3d54f47a-983d-8900-7ebd-64ab55ed406c@linux.ibm.com> Date: Wed, 20 Jul 2022 17:32:01 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Content-Language: en-US To: GCC Patches Subject: [PATCH] rs6000/test: Fix empty TU in some cases of effective targets X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: biXkAacPgaCZiixQv4YntarRW34ZDpyQ X-Proofpoint-GUID: g2If-4FpNnI2uoygZX4x391DVa-xzU2B X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.883,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-07-20_04,2022-07-19_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 lowpriorityscore=0 clxscore=1015 mlxscore=0 adultscore=0 priorityscore=1501 mlxlogscore=989 phishscore=0 suspectscore=0 spamscore=0 malwarescore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2206140000 definitions=main-2207200039 X-Spam-Status: No, score=-11.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP 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.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: "Kewen.Lin via Gcc-patches" From: "Kewen.Lin" Reply-To: "Kewen.Lin" Cc: Peter Bergner , David Edelsohn , Segher Boessenkool Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" Hi, As the failure of test case gcc.target/powerpc/pr92398.p9-.c in PR106345 shows, some test sources for some powerpc effective targets use empty translation unit wrongly. The test sources could go with options like "-ansi -pedantic-errors", then those effective target checkings will fail unexpectedly with the error messages like: error: ISO C forbids an empty translation unit [-Wpedantic] This patch is to fix empty TUs with one dummy variable definition accordingly. Tested on powerpc64-linux-gnu P7 and P8 and powerpc64le-linux-gnu P9 and P10. Excepting for the failures on gcc.target/powerpc/pr92398.p9-.c fixed, I can see it helps to bring back some testing coverage like: NA->PASS: gcc.target/powerpc/pr92398.p9+.c NA->PASS: gcc.target/powerpc/pr93453-1.c I'll push this soon if no objections. BR, Kewen ----- PR testsuite/106345 gcc/testsuite/ChangeLog: * lib/target-supports.exp (check_effective_target_powerpc_sqrt): Add a variable definition to avoid pedwarn about empty translation unit. (check_effective_target_has_arch_pwr5): Likewise. (check_effective_target_has_arch_pwr6): Likewise. (check_effective_target_has_arch_pwr7): Likewise. (check_effective_target_has_arch_pwr8): Likewise. (check_effective_target_has_arch_pwr9): Likewise. (check_effective_target_has_arch_pwr10): Likewise. (check_effective_target_has_arch_ppc64): Likewise. (check_effective_target_ppc_float128): Likewise. (check_effective_target_ppc_float128_insns): Likewise. (check_effective_target_powerpc_vsx): Likewise. --- gcc/testsuite/lib/target-supports.exp | 11 +++++++++++ 1 file changed, 11 insertions(+) -- 2.27.0 diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 4ed7b25b9a4..aac2a557f5d 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -6262,6 +6262,7 @@ proc check_effective_target_powerpc_sqrt { } { #ifndef _ARCH_PPCSQ #error _ARCH_PPCSQ is not defined #endif + int dummy; } {}] } @@ -6373,6 +6374,7 @@ proc check_effective_target_has_arch_pwr5 { } { #error does not have power5 support. #else /* "has power5 support" */ + int dummy; #endif } [current_compiler_flags]] } @@ -6383,6 +6385,7 @@ proc check_effective_target_has_arch_pwr6 { } { #error does not have power6 support. #else /* "has power6 support" */ + int dummy; #endif } [current_compiler_flags]] } @@ -6393,6 +6396,7 @@ proc check_effective_target_has_arch_pwr7 { } { #error does not have power7 support. #else /* "has power7 support" */ + int dummy; #endif } [current_compiler_flags]] } @@ -6403,6 +6407,7 @@ proc check_effective_target_has_arch_pwr8 { } { #error does not have power8 support. #else /* "has power8 support" */ + int dummy; #endif } [current_compiler_flags]] } @@ -6413,6 +6418,7 @@ proc check_effective_target_has_arch_pwr9 { } { #error does not have power9 support. #else /* "has power9 support" */ + int dummy; #endif } [current_compiler_flags]] } @@ -6423,6 +6429,7 @@ proc check_effective_target_has_arch_pwr10 { } { #error does not have power10 support. #else /* "has power10 support" */ + int dummy; #endif } [current_compiler_flags]] } @@ -6433,6 +6440,7 @@ proc check_effective_target_has_arch_ppc64 { } { #error does not have ppc64 support. #else /* "has ppc64 support" */ + int dummy; #endif } [current_compiler_flags]] } @@ -6523,6 +6531,7 @@ proc check_effective_target_ppc_float128 { } { #ifndef __FLOAT128__ nope no good #endif + int dummy; }] } @@ -6533,6 +6542,7 @@ proc check_effective_target_ppc_float128_insns { } { #ifndef __FLOAT128_HARDWARE__ nope no good #endif + int dummy; }] } @@ -6543,6 +6553,7 @@ proc check_effective_target_powerpc_vsx { } { #ifndef __VSX__ nope no vsx #endif + int dummy; }] }