From patchwork Mon Jul 25 06:26:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kewen.Lin" X-Patchwork-Id: 56292 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 9713A3841445 for ; Mon, 25 Jul 2022 06:26:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9713A3841445 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1658730414; bh=aXttFnH9VNaQaODExQgdBzh7NKSqOdYLmoXpaEJ4QWE=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=Eb/6uop1oYsFW7QfbgPZbGmGzdlBei8BA5TMG2GNemTkv499Gapx3sf1OtMXbTdhj 3Np5haz2g6xXliY+l9HJGMBOp742EEu+Plhj0WfyRdSH1oF1XqNJ6kZyJyEjI/JiRn /G1OMhPT98AOGDOGsGZd2tMrk8ArYwlo0wOSdIr4= 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 7D5E83858C20 for ; Mon, 25 Jul 2022 06:26:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7D5E83858C20 Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 26P6Ep03029707; Mon, 25 Jul 2022 06:26:24 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3hhnr6891d-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 25 Jul 2022 06:26:23 +0000 Received: from m0098404.ppops.net (m0098404.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 26P6HK7x012668; Mon, 25 Jul 2022 06:26:23 GMT Received: from ppma05fra.de.ibm.com (6c.4a.5195.ip4.static.sl-reverse.com [149.81.74.108]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3hhnr6890s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 25 Jul 2022 06:26:23 +0000 Received: from pps.filterd (ppma05fra.de.ibm.com [127.0.0.1]) by ppma05fra.de.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 26P6KOVX024999; Mon, 25 Jul 2022 06:26:20 GMT Received: from b06avi18878370.portsmouth.uk.ibm.com (b06avi18878370.portsmouth.uk.ibm.com [9.149.26.194]) by ppma05fra.de.ibm.com with ESMTP id 3hg94e9fj3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 25 Jul 2022 06:26:20 +0000 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06avi18878370.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 26P6QVGu27591134 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 25 Jul 2022 06:26:31 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 446FE4C046; Mon, 25 Jul 2022 06:26:18 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B87324C040; Mon, 25 Jul 2022 06:26:16 +0000 (GMT) Received: from [9.200.45.126] (unknown [9.200.45.126]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTP; Mon, 25 Jul 2022 06:26:16 +0000 (GMT) Message-ID: Date: Mon, 25 Jul 2022 14:26:15 +0800 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 v2] rs6000/test: Fix empty TU in some cases of effective targets [PR106345] X-TM-AS-GCONF: 00 X-Proofpoint-GUID: p3YeN3eyflf6pxsMdgUj33O9vsm9-AGB X-Proofpoint-ORIG-GUID: VyiRhlJaqYkloWN53KnV7vai5G51BRf8 X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 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-23_02,2022-07-21_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 impostorscore=0 phishscore=0 spamscore=0 lowpriorityscore=0 bulkscore=0 adultscore=0 suspectscore=0 mlxlogscore=999 clxscore=1015 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2206140000 definitions=main-2207250026 X-Spam-Status: No, score=-11.9 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+patchwork=sourceware.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 function definition accordingly. 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 Tested as before. v1: https://gcc.gnu.org/pipermail/gcc-patches/2022-July/598602.html v2: Use dummy function instead of dummy int as Segher suggested. Segher, does this v2 look good to you? BR, Kewen ----- PR testsuite/106345 gcc/testsuite/ChangeLog: * lib/target-supports.exp (check_effective_target_powerpc_sqrt): Add a function 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 | 33 +++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) -- 2.32.0 diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 4ed7b25b9a4..06484330178 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -6259,9 +6259,12 @@ proc check_effective_target_powerpc_sqrt { } { } return [check_no_compiler_messages powerpc_sqrt object { + void test (void) + { #ifndef _ARCH_PPCSQ #error _ARCH_PPCSQ is not defined #endif + } } {}] } @@ -6369,71 +6372,92 @@ proc check_effective_target_powerpc_p9modulo_ok { } { # as provided by the test. proc check_effective_target_has_arch_pwr5 { } { return [check_no_compiler_messages_nocache arch_pwr5 assembly { + void test (void) + { #ifndef _ARCH_PWR5 #error does not have power5 support. #else /* "has power5 support" */ #endif + } } [current_compiler_flags]] } proc check_effective_target_has_arch_pwr6 { } { return [check_no_compiler_messages_nocache arch_pwr6 assembly { + void test (void) + { #ifndef _ARCH_PWR6 #error does not have power6 support. #else /* "has power6 support" */ #endif + } } [current_compiler_flags]] } proc check_effective_target_has_arch_pwr7 { } { return [check_no_compiler_messages_nocache arch_pwr7 assembly { + void test (void) + { #ifndef _ARCH_PWR7 #error does not have power7 support. #else /* "has power7 support" */ #endif + } } [current_compiler_flags]] } proc check_effective_target_has_arch_pwr8 { } { return [check_no_compiler_messages_nocache arch_pwr8 assembly { + void test (void) + { #ifndef _ARCH_PWR8 #error does not have power8 support. #else /* "has power8 support" */ #endif + } } [current_compiler_flags]] } proc check_effective_target_has_arch_pwr9 { } { return [check_no_compiler_messages_nocache arch_pwr9 assembly { + void test (void) + { #ifndef _ARCH_PWR9 #error does not have power9 support. #else /* "has power9 support" */ #endif + } } [current_compiler_flags]] } proc check_effective_target_has_arch_pwr10 { } { return [check_no_compiler_messages_nocache arch_pwr10 assembly { + void test (void) + { #ifndef _ARCH_PWR10 #error does not have power10 support. #else /* "has power10 support" */ #endif + } } [current_compiler_flags]] } proc check_effective_target_has_arch_ppc64 { } { return [check_no_compiler_messages_nocache arch_ppc64 assembly { + void test (void) + { #ifndef _ARCH_PPC64 #error does not have ppc64 support. #else /* "has ppc64 support" */ #endif + } } [current_compiler_flags]] } @@ -6520,9 +6544,12 @@ proc check_effective_target_powerpc_float128_hw_ok { } { proc check_effective_target_ppc_float128 { } { return [check_no_compiler_messages_nocache ppc_float128 object { + void test (void) + { #ifndef __FLOAT128__ nope no good #endif + } }] } @@ -6530,9 +6557,12 @@ proc check_effective_target_ppc_float128 { } { proc check_effective_target_ppc_float128_insns { } { return [check_no_compiler_messages_nocache ppc_float128 object { + void test (void) + { #ifndef __FLOAT128_HARDWARE__ nope no good #endif + } }] } @@ -6540,9 +6570,12 @@ proc check_effective_target_ppc_float128_insns { } { proc check_effective_target_powerpc_vsx { } { return [check_no_compiler_messages_nocache powerpc_vsx object { + void test (void) + { #ifndef __VSX__ nope no vsx #endif + } }] }