From patchwork Tue Jun 18 18:22:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thiago Jung Bauermann X-Patchwork-Id: 805286 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:144:b0:362:4979:7f74 with SMTP id r4csp333177wrx; Tue, 18 Jun 2024 11:23:05 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU76PH8XkXuuZiRTVe5eaxmMfSnTbkrIGJ7I9S3ryEN14gjjwuwFExBzz0nSe8Fw1OXlFXukbopTH3QibaaRNH8 X-Google-Smtp-Source: AGHT+IEYxtCNPI+grdoaqYDkvDO+/KUlEY8D1PC84xu8z+LiRHKKjlByDr2QunZiWl63dgzARyC2 X-Received: by 2002:a05:6102:4a0e:b0:48d:a889:30a4 with SMTP id ada2fe7eead31-48f128f39aamr1028978137.1.1718734984980; Tue, 18 Jun 2024 11:23:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718734984; cv=pass; d=google.com; s=arc-20160816; b=XfXZ7D6N7eW0DH8uJZ0Hwh09Q1UI1O5+XDsRfhU80/xXm7o0ln6HWtB6wdaBfEfjLE cL80C9gGpOGenWifJ1Wyr7/hW6EEcxULv5RrGQT7nKy0R3dprBRXPt+9mN18eYYM1dEK GaBV5q1IJyi04MvIk3VpQfpuz2euD5U6vNFZJmduf1zIMcvzRQn/XgE7RnyqKDEFDCz3 xQNu1QIUPPZ/kabznEHHtu/aSaPAELK1RbgKmAdWPu4z9wati16BKCJ+yDJHpa8xf6VK 5f8WZX8TRAWQB49KKfI6iVxA3neG/jaIfk5WLvHinLhavHtf9YY7PWsudjsDaUi15feF wnEQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=FfUyjiCanzPIBpjSzVNW2dzG4v79g9PR0iGzfQfHfXo=; fh=tWtX2nBowArQFpO5tL5gtY10/+xKa8dUFoy2HZVoc4M=; b=bPYjujVVGBtoZbYsahZZB3CE8CQani24GDOZg0p0gWjhql7NOnmTTgpAENn+BuYqGj +gtozAHnS9asInRgEL1LqHIhEwHXLw6Jl/F0B4BAiUJh7TV3nI7KCBbgsJcr/J3Edfif bNHLz2tkqWFwrLbM+lXfUEUWuL8uHIXEyZLnGfMQ7CbeERazhtnCv/alYW4QtA0wP8J6 3sEppzx+VqFYBBslUrybK9DkNTRF14r7vZUHVyr/XewWjflODX9Re0alrHQ/VcQeA4wf Ibr6bZNh2Xd/iIEPe/oqxQAFfko49zNGvNmwffBbyHlV8AJtQmDZvIeCJyunL9xo0jtW fkvA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=kcaUsUnm; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+patch=linaro.org@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+patch=linaro.org@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id ada2fe7eead31-48da44cec18si2056598137.809.2024.06.18.11.23.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Jun 2024 11:23:04 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+patch=linaro.org@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=@linaro.org header.s=google header.b=kcaUsUnm; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+patch=linaro.org@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+patch=linaro.org@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 77047388302D for ; Tue, 18 Jun 2024 18:23:04 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-pf1-x42e.google.com (mail-pf1-x42e.google.com [IPv6:2607:f8b0:4864:20::42e]) by sourceware.org (Postfix) with ESMTPS id 462C4388302D for ; Tue, 18 Jun 2024 18:22:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 462C4388302D Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 462C4388302D Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::42e ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718734932; cv=none; b=nTTJ5EsCb5nSfdT1bXj+Soxg/5vShXh7lGrSzEA2CRypOIQ0AJAL983FPX/iOMYI2TUbFDv0sz4ZDxbbEhZCfMRBhxEPk9v81N+583T8WujEZoDNevM8HyO4Z/GYFAFgvrONrPgZVxWJ60zocitjMPgRNfP7sYgXRKqUE+09Qiw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718734932; c=relaxed/simple; bh=rE/nm6PAjPbmsVd0Jxbe93nstNOwih6Ve72lwCAosLA=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=rhLiN7hKR83ZwnKbZly2PGqvHO8RNRuoRTEvwBmjElAwQSfTq5jyqx+n57mAWXkNyu6oFdoHW3oC3WxlLKogr5gYZKTKxfe2t0XY2N30jjMhZ8Kln5ZdPfUcfdi0Qbbxkr21UCUj1jjIVXpe9dmOyZqfNh+coKEXdJ/+eoNcP0Q= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pf1-x42e.google.com with SMTP id d2e1a72fcca58-70623ec42c2so79902b3a.0 for ; Tue, 18 Jun 2024 11:22:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1718734929; x=1719339729; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=FfUyjiCanzPIBpjSzVNW2dzG4v79g9PR0iGzfQfHfXo=; b=kcaUsUnmLFZ3DUB+Ir06wIG0vQzVBUx5RiCTCdtkX+AtrElz++5bK93FbV2QwzQzcq gsEBNvGqf3DkVRUKUdt02qSwWjJCicKsFm2o75GmBi3OjMc7Sz15htxq2ZG+oJDUIiz+ bbdRBxPTLEjxinSEMdFikbeul5N6GODvE3MrE5hwPgI6GfyDHZcgKwJTLNbfXiQchPTC NpY9vUcO68o57WeFCDVnbC9GJTzyinCubrTpV7H42Qwg/oovoaRNdSxximfCtxJWnRJh idw3yLHoGs91dn1jz43NHToEmKHo9v8AOo4GovdGGnfqJsfRxfF1Gwu4lbDIlzU8O/BO EylQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718734929; x=1719339729; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=FfUyjiCanzPIBpjSzVNW2dzG4v79g9PR0iGzfQfHfXo=; b=kMHOT5OPNjPr7TFRWxRN3VzlhmvGL0kjbAL7awLFCSZLJq+9/dB1XT3kNTV+xUEYQw NKfEH2gOjEDWhW0VuX73AxlAwCdmWOiORpVGSygM31+q5E6ajFwNUmT+rLtgSxjmDX2a BwtPScrR5dwSZZMYf7FpiFgwMzLUFqdv+HbuIbikjjZqfRMHINW2cPWFGA4Wq9aEKLQn 4D7zdQpF2NX7aZTDBAhCMjR0i7j1ty64DK1zmVQsYC+uKnFoUN7Co9VZr39brGk3kD6V CDQwffTvGE+L2pEN7ZDnYoILb4n/fKVZlU1FUrz0LX+xpLtsqYddUPSKGe2YSfTOwyRl 0RwQ== X-Gm-Message-State: AOJu0Ywov7MKRzC9W392zgROBg3NsSKkxoGaMoeTBy/8TH9UE21Qk/xV 2r2LShSFnPCK/nFMyN4NN14d//p1uXdar3K6+djZwk+/jxVoS9OmJps7GySzI+MCuwWBdjIXsbI G X-Received: by 2002:a62:e309:0:b0:706:1ff1:c5ff with SMTP id d2e1a72fcca58-70628f770f3mr885449b3a.1.1718734924433; Tue, 18 Jun 2024 11:22:04 -0700 (PDT) Received: from localhost ([2804:14d:7e39:8470:f5e6:f3b6:fa94:4b9]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-705ccb6b9besm9251199b3a.165.2024.06.18.11.22.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Jun 2024 11:22:04 -0700 (PDT) From: Thiago Jung Bauermann To: gcc-patches@gcc.gnu.org Cc: libstdc++@gcc.gnu.org Subject: [PATCH] libstdc++: testsuite: Skip atomics test if there's no -latomic Date: Tue, 18 Jun 2024 15:22:01 -0300 Message-ID: <20240618182201.3518098-1-thiago.bauermann@linaro.org> X-Mailer: git-send-email 2.45.1 MIME-Version: 1.0 X-Spam-Status: No, score=-11.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=unavailable 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: , Errors-To: gcc-patches-bounces+patch=linaro.org@gcc.gnu.org On arm-none-eabi, 29_atomics/atomic_float/compare_exchange_padding.cc fails to build: FAIL: 29_atomics/atomic_float/compare_exchange_padding.cc -std=gnu++20 (test for excess errors) Excess errors: /home/bauermann/.cache/builds/combined-tree-thumb-m55-hard-eabi/ld/.libs/ld-new: cannot find -latomic: No such file or directory collect2: error: ld returned 1 exit status UNRESOLVED: 29_atomics/atomic_float/compare_exchange_padding.cc -std=gnu++20 compilation failed to produce executable This test should be skipped if libatomic is not available for the target. To that end, add dg-require-libatomic-available and use it in 29_atomics/atomic_float/compare_exchange_padding.cc. Also, check_effective_target_libatomic_available is fixed to use atomic_link_flags to properly compile the test executable. Tested on: - Host x86_64-linux-gnu, target arm-unknown-eabi - Native aarch64-linux-gnu - Native x86_64-linux-gnu gcc/testsuite/ * lib/target-supports-dg.exp (dg-require-libatomic-available): New procedure. * lib/target-supports.exp (check_effective_target_libatomic_available): Use atomic_link_flags. libstdc++-v3/ * testsuite/29_atomics/atomic_float/compare_exchange_padding.cc: Use dg-require-libatomic-available. --- gcc/testsuite/lib/target-supports-dg.exp | 9 +++++++++ gcc/testsuite/lib/target-supports.exp | 2 +- .../29_atomics/atomic_float/compare_exchange_padding.cc | 1 + 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/gcc/testsuite/lib/target-supports-dg.exp b/gcc/testsuite/lib/target-supports-dg.exp index 6dce9fdc1ce2..502e4e22b368 100644 --- a/gcc/testsuite/lib/target-supports-dg.exp +++ b/gcc/testsuite/lib/target-supports-dg.exp @@ -698,3 +698,12 @@ proc dg-require-prog-name-available { args } { } } +# If the atomic library is supported on this target, skip this test. + +proc dg-require-libatomic-available { args } { + set libatomic_available [check_effective_target_libatomic_available] + if { $libatomic_available == 0 } { + upvar dg-do-what dg-do-what + set dg-do-what [list [lindex ${dg-do-what} 0] "N" "P"] + } +} diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index e307f4e69efb..de27297c1787 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -1662,7 +1662,7 @@ proc check_iconv_available { test_what } { proc check_effective_target_libatomic_available { } { return [check_no_compiler_messages libatomic_available executable { int main (void) { return 0; } - } "-latomic"] + } "[atomic_link_flags [get_multilibs]] -latomic"] } # Return 1 if an ASCII locale is supported on this host, 0 otherwise. diff --git a/libstdc++-v3/testsuite/29_atomics/atomic_float/compare_exchange_padding.cc b/libstdc++-v3/testsuite/29_atomics/atomic_float/compare_exchange_padding.cc index 49626ac66511..351244b25279 100644 --- a/libstdc++-v3/testsuite/29_atomics/atomic_float/compare_exchange_padding.cc +++ b/libstdc++-v3/testsuite/29_atomics/atomic_float/compare_exchange_padding.cc @@ -1,4 +1,5 @@ // { dg-do run { target c++20 } } +// { dg-require-libatomic-available "" } // { dg-options "-O0" } // { dg-additional-options "[atomic_link_flags [get_multilibs]] -latomic" }