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: 1886352 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=bec7IMDj; dkim-atps=neutral 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=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.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 (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4TC0Ns647jz1yPy for ; Sun, 14 Jan 2024 00:58:21 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D650F385840C for ; Sat, 13 Jan 2024 13:58:19 +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-Google-Smtp-Source: AGHT+IFB9YpOS9685J0UKY/jfkr+L8MrGe0u+lmHlsE2pVLv7QTo38SqaHF7na9C/ihU3oV//OoMXQ== 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+incoming=patchwork.ozlabs.org@gcc.gnu.org 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* } } } */