From patchwork Sat Jan 13 13:57:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iain Sandoe X-Patchwork-Id: 187905 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2614:b0:101:6a76:bbe3 with SMTP id mm20csp769919dyc; Sat, 13 Jan 2024 05:58:43 -0800 (PST) X-Google-Smtp-Source: AGHT+IGN/Dy87VlcJ3y72cWQnW/RifnTuWFv1xmlDxfBXQ5Zzq8dkgi0Te0nC2iKUPWDKfP0AESl X-Received: by 2002:a05:6214:2427:b0:681:35b:ff6f with SMTP id gy7-20020a056214242700b00681035bff6fmr3596831qvb.29.1705154323153; Sat, 13 Jan 2024 05:58:43 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705154323; cv=pass; d=google.com; s=arc-20160816; b=ZQC+X//7IWD7izS9+PofMUuBemftF5TVkyIalPDnvLM7jwUG7Jjnhj0xT5iiSGrpaw sECk0bX1xlB6xqTASKQBkXfa3Mx7ub/2X8KwQYB/GVxzmsjJYmMG/0rb7DMGh4qQYj4J DaXVvqFFRf8HLlVeRw0XeXdCOgrl6lPJVgnyjtKriKWdLujrryOmLn/SCr2yMn9Rk4U2 3sfl1Ie1IRnynktHBQTeNC3hp9niDDYEYu3FQbB3il/XzVB91jSAENlyQ6VeCtWJV2pr gldqpcilAKo/K5hbWg5JNQgo7iQ6fhUgMuNnjb+m04zi+dawZ+bWduOdVTuSBf7r/rla +FUw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:reply-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature:arc-filter:dmarc-filter:delivered-to; bh=1vDyQ8D2OeLcfNf5c8zPee+y4u5ONdwYZSuu4WMfMmM=; fh=hquFfmNSiHACMF06VYcgSDOPZqbHeYlOOHoweb40YaM=; b=gk7dgRenZDmbUteDolSqVVgdC4xAhXBP9WSKdOApzmobw8HPJiFbEkcWmJzvGlzney 9RudC3AlISzzNm0ODD1uPhfqhGk711t3XJ+8Qp4wWVsAs2CS7E2wGQhZbiQB6LZLljzx rLhE/Hfl+xlednaHyxPdrY1kTlrEJENwjbdrDAYMTG6wtFYNWOFdUTHLMvMPsj1Q/nbp Dni+iF/siEIY+fC2iGVPbQ+c0q2eM0adskGQ5912JR3RNOAlEo86p0sYaWkCu/RNL7OK 8ONH2fihEYsFlbIUbK/k+42p4ZFIWfHLyjsutZ3uNLKBgx/NN4CzVxZlFm60xsIhOI7i ZZDw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=bec7IMDj; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id y9-20020a0cc549000000b0068096de9f54si4690816qvi.348.2024.01.13.05.58.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 13 Jan 2024 05:58:43 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=bec7IMDj; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A5D96385801F for ; Sat, 13 Jan 2024 13:58:42 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by sourceware.org (Postfix) with ESMTPS id 0A7F53858C53 for ; Sat, 13 Jan 2024 13:57:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0A7F53858C53 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 0A7F53858C53 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::42c ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705154258; cv=none; b=QeP2JOLRUBeADVO4BZsinZM143oILlX+Hr0CHhg0hMS/wAVhbEi1Y9SYGCbFGqyk6LEEubLi8NdTuJ3LMgpu3ILKvvKLZsrAOAV+UIaw/funuuSDwSQaH0TbGhyitAEPhgyNwEs3+LwT381eqInVD8WKdU+e1q5wBQqwuaZzZPg= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705154258; c=relaxed/simple; bh=lrxHoqRz6Fzj2jk5DoxJW/yeGLfSecCmvWP/b5GmloE=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=ueOGi7JqGoqeoMpe2ggdUpyJmsY3wo2pYKT1wqhRk8Q6VWIhgyJeaP6gVHCcoytEOhc9x1D0gIp2fCTGygdPH7YESovXXwiZJ5nxQQuccF8+9hoeLM6mNsBoZMk/oE0UVHqbrHEXnHdO/fs/eMomTFcgrhllv5megaZ8QuMFJtI= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-3366e78d872so7455597f8f.3 for ; Sat, 13 Jan 2024 05:57:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705154255; x=1705759055; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:reply-to:references :in-reply-to:message-id:date:subject:to:from:from:to:cc:subject:date :message-id:reply-to; bh=1vDyQ8D2OeLcfNf5c8zPee+y4u5ONdwYZSuu4WMfMmM=; b=bec7IMDjNWjSlxqj9haLSoMCqkzUVmtZTYTCJZvm/BjE7NLlPl4Yrc4IdYH5MYNbw0 vYl6Rxp2KM8M/lCDP0weLeFVnc1QZ4Xpo2Z5tZOf/E6iIbgo7fb5Nli6ydjIvzbqX9t/ ndF3dBvc1LQgzfnrO5bwcKjJ9kziat1J5Map2qBEGpDc0v9BuSRliby26dMYjpvmuPlW /OMXVa1BGdPQQHk7vSjFGqwtCGV/hWySuz70qws5p+i8AubSnCwE19n2jIPeVuj6XN1u bPWtyz9jaCNcq+GQi3yyl7HCoEB2ui/2slhpQn+BRgRzPcgZJQxEQy5K4c8E7kvdLlhW nurw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705154255; x=1705759055; h=content-transfer-encoding:mime-version:reply-to:references :in-reply-to:message-id:date:subject:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=1vDyQ8D2OeLcfNf5c8zPee+y4u5ONdwYZSuu4WMfMmM=; b=ALHxX+Rz5AAyehaNM2yCwJqAUsvb0mXrYMtGgD33y1AoU9MFgn7BzCVoqwwa+e2UOn bIEb8TMka4vgrhMPJxh8F41VDY/7y58Oe0YGTZhW2MhCfPXdoS8UB0EzEpHgjQ852+zF A2CteFLUznWg90YHXImwlW6c2oZ6nnYacOx4ELMmVYjShUW1gD78edyIjE6EYuDomola 0WXQvNRyB71jKcDkiYwg8UKOw14T0QEaoDDvB7vocJc76SO34qslUfDgi2MYGkahHy2y eLqUJrEE+6ACGm3B/tn89BJzcD21vadoomUz5a8SKsKFnTTc+gWKjBbbNUtQFr+WRsYk oHwA== X-Gm-Message-State: AOJu0Yw84ujo4qT7z0Fa3uIfuynD9OKsvoZ4AGAuc3dBIwlAtCb8Sv/f 7Kiimpshz3TJjkQdOE2GiOGIW7TWZRM= X-Received: by 2002:adf:e7c4:0:b0:337:6322:f4e3 with SMTP id e4-20020adfe7c4000000b003376322f4e3mr713373wrn.192.1705154254581; Sat, 13 Jan 2024 05:57:34 -0800 (PST) Received: from localhost.localdomain (host81-138-1-83.in-addr.btopenworld.com. [81.138.1.83]) by smtp.gmail.com with ESMTPSA id h7-20020adff4c7000000b0033677aae2e2sm6807083wrp.107.2024.01.13.05.57.34 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 13 Jan 2024 05:57:34 -0800 (PST) From: Iain Sandoe X-Google-Original-From: Iain Sandoe To: dmalcolm@redhat.com, gcc-patches@gcc.gnu.org Subject: [PATCH 4/4] testsuite,jit: Handle Darwin/Mach-O in assembler tests. Date: Sat, 13 Jan 2024 13:57:18 +0000 Message-Id: <20240113135718.57643-5-iain@sandoe.co.uk> X-Mailer: git-send-email 2.39.2 (Apple Git-143) In-Reply-To: <20240113135718.57643-4-iain@sandoe.co.uk> References: <20240113135718.57643-1-iain@sandoe.co.uk> <20240113135718.57643-2-iain@sandoe.co.uk> <20240113135718.57643-3-iain@sandoe.co.uk> <20240113135718.57643-4-iain@sandoe.co.uk> MIME-Version: 1.0 X-Spam-Status: No, score=-8.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, 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: , Reply-To: iain@sandoe.co.uk Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1787983899540089666 X-GMAIL-MSGID: 1787983899540089666 Several of the jit tests check for assembler-specific output which differs on Mach-O from ELF. This patch uses the facility to make the scans targer-dependent and adds handling for darwin. gcc/testsuite/ChangeLog: * jit.dg/test-always_inline-attribute.c: Handle Darwin in jit-verify-assembler-output. * jit.dg/test-noinline-attribute.c: Likewise. * jit.dg/test-setting-alignment.c: Likewise. * jit.dg/test-used-attribute.c: Likewise. * jit.dg/test-variable-attribute.c: Likewise. * jit.dg/test-weak-attribute.c: Likewise. Signed-off-by: Iain Sandoe --- gcc/testsuite/jit.dg/test-always_inline-attribute.c | 10 +++++++--- gcc/testsuite/jit.dg/test-noinline-attribute.c | 10 +++++++--- gcc/testsuite/jit.dg/test-setting-alignment.c | 3 ++- gcc/testsuite/jit.dg/test-used-attribute.c | 10 +++++++--- gcc/testsuite/jit.dg/test-variable-attribute.c | 10 ++++++---- gcc/testsuite/jit.dg/test-weak-attribute.c | 3 ++- 6 files changed, 31 insertions(+), 15 deletions(-) diff --git a/gcc/testsuite/jit.dg/test-always_inline-attribute.c b/gcc/testsuite/jit.dg/test-always_inline-attribute.c index 5c3f386663f..f7201a17140 100644 --- a/gcc/testsuite/jit.dg/test-always_inline-attribute.c +++ b/gcc/testsuite/jit.dg/test-always_inline-attribute.c @@ -148,6 +148,10 @@ int foo () { /* { dg-final { jit-verify-output-file-was-created "" } } */ /* Check that the "removed" function was inlined, but not the others */ -/* { dg-final { jit-verify-assembler-output-not ".type\\s+removed,\\s+@function" } } */ -/* { dg-final { jit-verify-assembler-output ".type\\s+not_removed,\\s+@function" } } */ -/* { dg-final { jit-verify-assembler-output ".type\\s+foo,\\s+@function" } } */ +/* { dg-final { jit-verify-assembler-output-not ".type\\s+removed,\\s+@function" { target { ! *-*-darwin* } } } } */ +/* { dg-final { jit-verify-assembler-output ".type\\s+not_removed,\\s+@function" { target { ! *-*-darwin* } } } } */ +/* { dg-final { jit-verify-assembler-output ".type\\s+foo,\\s+@function" { target { ! *-*-darwin* } } } } */ + +/* { dg-final { jit-verify-assembler-output-not "\\n_removed:" { target *-*-darwin* } } } */ +/* { dg-final { jit-verify-assembler-output "\\n_not_removed:" { target *-*-darwin* } } } */ +/* { dg-final { jit-verify-assembler-output "\\n_foo:" { target *-*-darwin* } } } */ diff --git a/gcc/testsuite/jit.dg/test-noinline-attribute.c b/gcc/testsuite/jit.dg/test-noinline-attribute.c index eac6cae6b6a..acfea8fc55e 100644 --- a/gcc/testsuite/jit.dg/test-noinline-attribute.c +++ b/gcc/testsuite/jit.dg/test-noinline-attribute.c @@ -114,6 +114,10 @@ int foo () { /* { dg-final { jit-verify-output-file-was-created "" } } */ /* Check that the "removed" function was inlined, but not the others */ -/* { dg-final { jit-verify-assembler-output-not ".type\\s+removed.isra.0,\\s+@function" } } */ -/* { dg-final { jit-verify-assembler-output ".type\\s+not_removed.isra.0,\\s+@function" } } */ -/* { dg-final { jit-verify-assembler-output ".type\\s+foo,\\s+@function" } } */ +/* { dg-final { jit-verify-assembler-output-not ".type\\s+removed.isra.0,\\s+@function" { target { ! *-*-darwin* } } } } */ +/* { dg-final { jit-verify-assembler-output ".type\\s+not_removed.isra.0,\\s+@function" { target { ! *-*-darwin* } } } } */ +/* { dg-final { jit-verify-assembler-output ".type\\s+foo,\\s+@function" { target { ! *-*-darwin* } } } } */ + +/* { dg-final { jit-verify-assembler-output-not "\\n_removed.isra.0:" { target *-*-darwin* } } } */ +/* { dg-final { jit-verify-assembler-output "\\n_not_removed.isra.0:" { target *-*-darwin* } } } */ +/* { dg-final { jit-verify-assembler-output "\\n_foo:" { target *-*-darwin* } } } */ diff --git a/gcc/testsuite/jit.dg/test-setting-alignment.c b/gcc/testsuite/jit.dg/test-setting-alignment.c index 8489df9c6b9..14edc723f61 100644 --- a/gcc/testsuite/jit.dg/test-setting-alignment.c +++ b/gcc/testsuite/jit.dg/test-setting-alignment.c @@ -62,5 +62,6 @@ create_code (gcc_jit_context *ctxt, void *user_data) } /* { dg-final { jit-verify-output-file-was-created "" } } */ -/* { dg-final { jit-verify-assembler-output ".comm foo,4,8" } } */ +/* { dg-final { jit-verify-assembler-output ".comm foo,4,8" { target { ! *-*-darwin* } } } } */ +/* { dg-final { jit-verify-assembler-output ".comm\\s_foo,4,3" { target *-*-darwin* } } } */ /* { dg-final { jit-verify-assembler-output "movl -16\\\(%rbp\\\), %eax" } } */ diff --git a/gcc/testsuite/jit.dg/test-used-attribute.c b/gcc/testsuite/jit.dg/test-used-attribute.c index cb20952c687..446c5c5c31b 100644 --- a/gcc/testsuite/jit.dg/test-used-attribute.c +++ b/gcc/testsuite/jit.dg/test-used-attribute.c @@ -107,6 +107,10 @@ int foo() { /* { dg-final { jit-verify-output-file-was-created "" } } */ /* Check that the "removed" function was inlined, but not the others */ -/* { dg-final { jit-verify-assembler-output-not ".type\\s+removed,\\s+@function" } } */ -/* { dg-final { jit-verify-assembler-output ".type\\s+not_removed,\\s+@function" } } */ -/* { dg-final { jit-verify-assembler-output ".type\\s+foo,\\s+@function" } } */ +/* { dg-final { jit-verify-assembler-output-not ".type\\s+removed,\\s+@function" { target { ! *-*-darwin* } } } } */ +/* { dg-final { jit-verify-assembler-output ".type\\s+not_removed,\\s+@function" { target { ! *-*-darwin* } } } } */ +/* { dg-final { jit-verify-assembler-output ".type\\s+foo,\\s+@function" { target { ! *-*-darwin* } } } } */ + +/* { dg-final { jit-verify-assembler-output-not "\\n_removed:" { target *-*-darwin* } } } */ +/* { dg-final { jit-verify-assembler-output "\\n_not_removed:" { target *-*-darwin* } } } */ +/* { dg-final { jit-verify-assembler-output "\\n_foo:" { target *-*-darwin* } } } */ diff --git a/gcc/testsuite/jit.dg/test-variable-attribute.c b/gcc/testsuite/jit.dg/test-variable-attribute.c index ea854ff4a9f..219a47d8817 100644 --- a/gcc/testsuite/jit.dg/test-variable-attribute.c +++ b/gcc/testsuite/jit.dg/test-variable-attribute.c @@ -40,7 +40,9 @@ int PUBLIC = 12; /* { dg-final { jit-verify-output-file-was-created "" } } */ /* Check that the attribute was applied correctly */ -/* { dg-final { jit-verify-assembler-output ".hidden\\s+PRIVATE" } } */ -/* { dg-final { jit-verify-assembler-output ".globl\\s+PRIVATE" } } */ -/* { dg-final { jit-verify-assembler-output-not ".hidden\\s+PUBLIC" } } */ -/* { dg-final { jit-verify-assembler-output ".globl\\s+PUBLIC" } } */ +/* { dg-final { jit-verify-assembler-output ".hidden\\s+PRIVATE" { target { ! *-*-darwin* } } } } */ +/* { dg-final { jit-verify-assembler-output ".private_extern\\s+_PRIVATE" { target *-*-darwin* } } } */ +/* { dg-final { jit-verify-assembler-output ".globl\\s+_?PRIVATE" } } */ +/* { dg-final { jit-verify-assembler-output-not ".hidden\\s+PUBLIC" { target { ! *-*-darwin* } } } } */ +/* { dg-final { jit-verify-assembler-output-not ".private_extern\\s+_PUBLIC" { target *-*-darwin* } } } */ +/* { dg-final { jit-verify-assembler-output ".globl\\s+_?PUBLIC" } } */ diff --git a/gcc/testsuite/jit.dg/test-weak-attribute.c b/gcc/testsuite/jit.dg/test-weak-attribute.c index 546ade1c3c4..3ca9485bf41 100644 --- a/gcc/testsuite/jit.dg/test-weak-attribute.c +++ b/gcc/testsuite/jit.dg/test-weak-attribute.c @@ -38,4 +38,5 @@ void f () {} /* { dg-final { jit-verify-output-file-was-created "" } } */ /* Check that the attribute was applied correctly */ -/* { dg-final { jit-verify-assembler-output ".weak\\s+f" } } */ +/* { dg-final { jit-verify-assembler-output ".weak\\s+f" { target { ! *-*-darwin* } } } } */ +/* { dg-final { jit-verify-assembler-output ".weak_definition\\s+_f" { target *-*-darwin* } } } */