From patchwork Fri Jan 13 12:42:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xianmiao Qu X-Patchwork-Id: 1725933 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.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=) Authentication-Results: legolas.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=bro6rTTv; dkim-atps=neutral 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 ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Ntgzz2GjHz23dq for ; Fri, 13 Jan 2023 23:42:39 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3DBAA38560A6 for ; Fri, 13 Jan 2023 12:42:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3DBAA38560A6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1673613757; bh=lhLW7UfaGaOQfSYYjH2XasHSKcSA3AjVOsIUQ3UFny8=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=bro6rTTvRgPHrVbN+ccgZlCqe5E6+yzWYcNYq9+Qq8l33innUT/k/kacEu0hjILnE 2hFx2BiWxnYiIBqzNdk/THj1OZBHLWz3ZQEj1cfLuCC7GFiQDMTZTynRu3+W5+CC+O qfpYVXK7QHkfwfhRqzQ/8ntNldkb7Zt3ixAmLycI= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from out30-113.freemail.mail.aliyun.com (out30-113.freemail.mail.aliyun.com [115.124.30.113]) by sourceware.org (Postfix) with ESMTPS id 631B03858D32 for ; Fri, 13 Jan 2023 12:42:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 631B03858D32 X-Alimail-AntiSpam: AC=PASS; BC=-1|-1; BR=01201311R161e4; CH=green; DM=||false|; DS=||; FP=0|-1|-1|-1|0|-1|-1|-1; HT=ay29a033018045170; MF=cooper.qu@linux.alibaba.com; NM=1; PH=DS; RN=1; SR=0; TI=SMTPD_---0VZUoojv_1673613731; Received: from localhost(mailfrom:cooper.qu@linux.alibaba.com fp:SMTPD_---0VZUoojv_1673613731) by smtp.aliyun-inc.com; Fri, 13 Jan 2023 20:42:12 +0800 To: gcc-patches@gcc.gnu.org Subject: [committed] C-SKY: Skip other CPUs if the testcases are only for ck801. Date: Fri, 13 Jan 2023 20:42:11 +0800 Message-Id: <20230113124211.75278-1-cooper.qu@linux.alibaba.com> X-Mailer: git-send-email 2.32.1 (Apple Git-133) MIME-Version: 1.0 X-Spam-Status: No, score=-20.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH, GIT_PATCH_0, KAM_DMARC_STATUS, KAM_SHORT, SPF_HELO_NONE, SPF_PASS, TXREP, UNPARSEABLE_RELAY, USER_IN_DEF_SPF_WL 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: Xianmiao Qu via Gcc-patches From: Xianmiao Qu Reply-To: Xianmiao Qu Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" Refine some testcases for ck801, if the testcase is only for ck801, add the filename prefix "ck801-", and add dg-skip-if to skip other CPUs. gcc/testsuite/ * gcc.target/csky/and3a.c: Rename to ... * gcc.target/csky/ck801-and.c: ... this. * gcc.target/csky/constpool-3.c: Rename to ... * gcc.target/csky/constpool-2.c: ... this, Rename to ... * gcc.target/csky/constpool-1.c: ... this, Rename to ... * gcc.target/csky/ck801-constpool.c: ... this, and skip if the CPU is not ck801. * gcc.target/csky/ck801-branch.c: Skip if the CPU is not ck801. --- .../gcc.target/csky/{and3a.c => ck801-and.c} | 3 ++- gcc/testsuite/gcc.target/csky/ck801-branch.c | 3 ++- gcc/testsuite/gcc.target/csky/ck801-constpool.c | 17 +++++++++++++++++ gcc/testsuite/gcc.target/csky/constpool-1.c | 7 +++---- gcc/testsuite/gcc.target/csky/constpool-2.c | 8 ++++---- gcc/testsuite/gcc.target/csky/constpool-3.c | 15 --------------- 6 files changed, 28 insertions(+), 25 deletions(-) rename gcc/testsuite/gcc.target/csky/{and3a.c => ck801-and.c} (64%) create mode 100644 gcc/testsuite/gcc.target/csky/ck801-constpool.c delete mode 100644 gcc/testsuite/gcc.target/csky/constpool-3.c diff --git a/gcc/testsuite/gcc.target/csky/and3a.c b/gcc/testsuite/gcc.target/csky/ck801-and.c similarity index 64% rename from gcc/testsuite/gcc.target/csky/and3a.c rename to gcc/testsuite/gcc.target/csky/ck801-and.c index 3d706f6eb58..7c79879278d 100644 --- a/gcc/testsuite/gcc.target/csky/and3a.c +++ b/gcc/testsuite/gcc.target/csky/ck801-and.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-csky-options "-mcpu=ck801 -O1" } */ +/* { dg-skip-if "test is specific to ck801" { csky-*-* } { "*" } { "-mcpu=ck801" } } */ +/* { dg-csky-options "-O1" } */ /* Test special code generation patterns for bit operators. */ diff --git a/gcc/testsuite/gcc.target/csky/ck801-branch.c b/gcc/testsuite/gcc.target/csky/ck801-branch.c index 95e69624475..e4dafb37e89 100644 --- a/gcc/testsuite/gcc.target/csky/ck801-branch.c +++ b/gcc/testsuite/gcc.target/csky/ck801-branch.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ -/* { dg-csky-options "-mcpu=ck801 -O1 -fno-reorder-blocks" } */ +/* { dg-skip-if "test is specific to ck801" { csky-*-* } { "*" } { "-mcpu=ck801" } } */ +/* { dg-csky-options "-O1 -fno-reorder-blocks" } */ /* Test branch generation on CK801, which cannot rely on assembler branch relaxation because long branches clobber lr. */ diff --git a/gcc/testsuite/gcc.target/csky/ck801-constpool.c b/gcc/testsuite/gcc.target/csky/ck801-constpool.c new file mode 100644 index 00000000000..5c92f39d0ab --- /dev/null +++ b/gcc/testsuite/gcc.target/csky/ck801-constpool.c @@ -0,0 +1,17 @@ +/* { dg-do compile } */ +/* { dg-skip-if "test is specific to ck801" { csky-*-* } { "*" } { "-mcpu=ck801" } } */ +/* { dg-csky-options "-O1" } */ + +/* Make sure that constant pools are emitted by the compiler for ck801. + If this is deferred to the assembler, the compiler will compute + incorrect branch offsets. */ + +void f (unsigned int *u, long long int *l, float *f, double *d) +{ + *u = 0xdeadbeef; + *l = 0xcafef00dc0ffeeULL; + *f = 3.14159F; + *d = 2.718281828459; +} + +/* { dg-final { scan-assembler-times "\\.long" 6 } } */ diff --git a/gcc/testsuite/gcc.target/csky/constpool-1.c b/gcc/testsuite/gcc.target/csky/constpool-1.c index 5c7cfdc73bd..d654420bc3f 100644 --- a/gcc/testsuite/gcc.target/csky/constpool-1.c +++ b/gcc/testsuite/gcc.target/csky/constpool-1.c @@ -1,9 +1,8 @@ /* { dg-do compile } */ -/* { dg-csky-options "-mcpu=ck801 -O1" } */ +/* { dg-csky-options "-mcpu=ck810f -O1 -mconstpool" } */ -/* Make sure that constant pools are emitted by the compiler for ck801. - If this is deferred to the assembler, the compiler will compute - incorrect branch offsets. */ +/* Make sure that constant pools are emitted by the compiler when + -mconstpool is provided. */ void f (unsigned int *u, long long int *l, float *f, double *d) { diff --git a/gcc/testsuite/gcc.target/csky/constpool-2.c b/gcc/testsuite/gcc.target/csky/constpool-2.c index d654420bc3f..e3a6e095f5b 100644 --- a/gcc/testsuite/gcc.target/csky/constpool-2.c +++ b/gcc/testsuite/gcc.target/csky/constpool-2.c @@ -1,8 +1,8 @@ /* { dg-do compile } */ -/* { dg-csky-options "-mcpu=ck810f -O1 -mconstpool" } */ +/* { dg-csky-options "-mcpu=ck810f -O1 -mno-constpool" } */ -/* Make sure that constant pools are emitted by the compiler when - -mconstpool is provided. */ +/* Make sure that constant pools are not emitted by the compiler when + -mno-constpool is provided. */ void f (unsigned int *u, long long int *l, float *f, double *d) { @@ -12,4 +12,4 @@ void f (unsigned int *u, long long int *l, float *f, double *d) *d = 2.718281828459; } -/* { dg-final { scan-assembler-times "\\.long" 6 } } */ +/* { dg-final { scan-assembler-not "\\.long" } } */ diff --git a/gcc/testsuite/gcc.target/csky/constpool-3.c b/gcc/testsuite/gcc.target/csky/constpool-3.c deleted file mode 100644 index e3a6e095f5b..00000000000 --- a/gcc/testsuite/gcc.target/csky/constpool-3.c +++ /dev/null @@ -1,15 +0,0 @@ -/* { dg-do compile } */ -/* { dg-csky-options "-mcpu=ck810f -O1 -mno-constpool" } */ - -/* Make sure that constant pools are not emitted by the compiler when - -mno-constpool is provided. */ - -void f (unsigned int *u, long long int *l, float *f, double *d) -{ - *u = 0xdeadbeef; - *l = 0xcafef00dc0ffeeULL; - *f = 3.14159F; - *d = 2.718281828459; -} - -/* { dg-final { scan-assembler-not "\\.long" } } */