Message ID | cb732088-3376-c06a-8faa-77037a9cade3@linux.ibm.com |
---|---|
State | New, archived |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:6a10:b5d6:b0:2b9:3548:2db5 with SMTP id v22csp1476927pxt; Sun, 24 Jul 2022 23:27:10 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tT6skH4A5+nwqptSwldBSIK+82/elTRsmDT2QWIYa2DXPyDcFaOmaNNXoXtC2Tu5dAMlg9 X-Received: by 2002:a05:6402:2d5:b0:43b:d73d:39b0 with SMTP id b21-20020a05640202d500b0043bd73d39b0mr11619629edx.208.1658730430187; Sun, 24 Jul 2022 23:27:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658730430; cv=none; d=google.com; s=arc-20160816; b=fq9RYzwTEYFMQP5HOlowI3gHybeE4powP/M2lC3CjyA8hLrLWuUW+jVS0RY44VeySE +vomReqtpGUB8m18rRJXBSwlBXVOFohDTCmws4yy5s16FhWTzJCUdaIU7Olm2N2J6j81 stAvdGU7uEQjudTuM3WuE8tG6KPfQJM2Qc/jxAV/Rd3C8ohijhDZasC/vWOW656dCLv8 OW8EpwOt4WW09Rq5KuEguqLGXKl8HlJTSx3L+UZIO0gIj9OAvBYhIP+WaYL3fQOKP1KJ 5twdq+75If4+6HhZmOvFyO+8r66SZo+Xqi1YklYgQREmSZ1Xj2Zp2y7yrf/yQmuDTRBY 6gUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:reply-to:from:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :mime-version:content-transfer-encoding:subject:to:content-language :user-agent:date:message-id:dmarc-filter:delivered-to:dkim-signature :dkim-filter; bh=aXttFnH9VNaQaODExQgdBzh7NKSqOdYLmoXpaEJ4QWE=; b=EZv3X40/zWansoqmou4G+VoCm9yOqfW5lqtQeKZIQwySz/5uojgF8MQel1cLe0laaT N4GBIsI2mKtAkeZEhOuLKP92V2734Z6hsvX+3IKebsLYriJQ+nFgkSg402V1CgRyFQK2 KIqR0nETr0jFEiuirWdIAtf2laAc7v1fI5MVXsz7ES3oPZiNhURlLElMk4bo95/Mmi91 3+kVgASq8rpmFHY6KD4tt5oz9MZS/2H5ChJEPL59Dw1V3RdluDLNikhDDIOI9HT4+quE gurE/Eu7iwvNgHnHbGp90aL6T3D0NMvKzAjM+d+0bL8tTDiNQQ14gAoJWSwZGgvODoLS xfdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=iF5UsDfv; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id jj24-20020a170907985800b0072b3a923e6csi10994883ejc.974.2022.07.24.23.27.09 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Jul 2022 23:27:10 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=iF5UsDfv; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C6F5D384144B for <ouuuleilei@gmail.com>; Mon, 25 Jul 2022 06:27:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C6F5D384144B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1658730428; bh=aXttFnH9VNaQaODExQgdBzh7NKSqOdYLmoXpaEJ4QWE=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=iF5UsDfv8/UIhP4j68Q67mEETLFuuf+h7e/b6NWKWotue0d1KOzpY+bStOa8C0O2X b71rafhoVQQzlT6aKE1sraKseqUpnQAwV0/i167hNWMqW2NlzXWh3+arJcDlmmhseM 8QooTGdNOzU/cJfjyA5mwBRlTSwdvB+f9TnOPR0Y= 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 <gcc-patches@gcc.gnu.org>; 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: <cb732088-3376-c06a-8faa-77037a9cade3@linux.ibm.com> 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 <gcc-patches@gcc.gnu.org> Subject: [PATCH v2] rs6000/test: Fix empty TU in some cases of effective targets [PR106345] Content-Type: text/plain; charset=UTF-8 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: p3YeN3eyflf6pxsMdgUj33O9vsm9-AGB X-Proofpoint-ORIG-GUID: VyiRhlJaqYkloWN53KnV7vai5G51BRf8 Content-Transfer-Encoding: 7bit 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 <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> From: "Kewen.Lin via Gcc-patches" <gcc-patches@gcc.gnu.org> Reply-To: "Kewen.Lin" <linkw@linux.ibm.com> Cc: Peter Bergner <bergner@linux.ibm.com>, David Edelsohn <dje.gcc@gmail.com>, Segher Boessenkool <segher@kernel.crashing.org> Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1739304919789086526?= X-GMAIL-MSGID: =?utf-8?q?1739304919789086526?= |
Series |
[v2] rs6000/test: Fix empty TU in some cases of effective targets [PR106345]
|
|
Commit Message
Li, Pan2 via Gcc-patches
July 25, 2022, 6:26 a.m. UTC
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
Comments
Hi, Gentle ping this: https://gcc.gnu.org/pipermail/gcc-patches/2022-July/598748.html BR, Kewen on 2022/7/25 14:26, Kewen.Lin via Gcc-patches wrote: > 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(+) > > 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 > + } > }] > } > > -- > 2.32.0
Hi, Gentle ping this: https://gcc.gnu.org/pipermail/gcc-patches/2022-July/598748.html BR, Kewen > on 2022/7/25 14:26, Kewen.Lin via Gcc-patches wrote: >> 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(+) >> >> 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 >> + } >> }] >> } >> >> -- >> 2.32.0
Hi Segher, Gentle ping this patch as you wanted empty TU issue to be fixed first at the discussion [1]. Thanks in advance for your time! [1] https://gcc.gnu.org/pipermail/gcc-patches/2022-September/600927.html BR, Kewen on 2022/7/25 14:26, Kewen.Lin via Gcc-patches wrote: > 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(+) > > 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 > + } > }] > } > > -- > 2.32.0
Hi! On Mon, Jul 25, 2022 at 02:26:15PM +0800, Kewen.Lin wrote: > 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. > * 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. Sorry, I thought you had committed this already. Oops. Okay for trunk, and for all backports you want. Thanks! Segher
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 + } }] }