From patchwork Fri Mar 8 08:38:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 1909548 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=BQqSORMU; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; 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 [8.43.85.97]) (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 4Trfj26M4Gz1yWy for ; Fri, 8 Mar 2024 19:39:02 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B49AF385C301 for ; Fri, 8 Mar 2024 08:39:00 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id B66523858D35 for ; Fri, 8 Mar 2024 08:38:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B66523858D35 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org B66523858D35 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709887117; cv=none; b=Ig/Z8qGciLeiIRMqILPutjEbplH6PtxQRT8IEzVJXiQmX/6faZDU0eJcQ+skTmDysPKOfjLe8nqf8B+gWl9WkisyTlFdw7zKon4/OrHiPiY+xGCfL1Rvjpixeq1EPR/+fHOqGXN3af9wG1VMTDYMsxzSuNPfS0H6tpd2v89sjGY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709887117; c=relaxed/simple; bh=NJ7X4wMFFkTuxIZDvf2s2onwnBXm5j0JsUM9KZrOP3Y=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=xMca9j10Xcxfb5k1BxpjxAEva5lweEo7xG8F65xYZm09nvIfKtF2WVoEEAAzZMaSJUfz8bDdM99jUPICnxJtoc8SnS/5N0oTVb9lm5xh6M9xoFJDgq56/Tj/IA37RLwCiVlmVvC7yn5whRB3bgO3V53J1dL8wIKAfxW/lUdqzNE= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1709887115; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type; bh=yz9JDcszicHnXKi9wbCvi9pBsUk3PeT7dXW1wEWf1JQ=; b=BQqSORMUQoTEtGB98/wRbH4nDDpjOBIqFh6L0a/SA03u+HTjNEs9Ix9MP6N5dG+sAjfclV Bdx5tmGpU0qCOW8sQBt4zFQnC3xYppNEf2tTO9zZwkJ4/ArUvOFO3HAeYTKVIXUcOXBa3B YHcCwKOOkZReibQ9NUmm6ss2sjlSt8I= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-677-rsW7HoRtNhuXGQV6itRXoA-1; Fri, 08 Mar 2024 03:38:32 -0500 X-MC-Unique: rsW7HoRtNhuXGQV6itRXoA-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 40E82800265; Fri, 8 Mar 2024 08:38:16 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.45.226.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 06E97492BDC; Fri, 8 Mar 2024 08:38:15 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.17.1/8.17.1) with ESMTPS id 4288cE7K2678891 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Fri, 8 Mar 2024 09:38:14 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 4288cECC2678889; Fri, 8 Mar 2024 09:38:14 +0100 Date: Fri, 8 Mar 2024 09:38:13 +0100 From: Jakub Jelinek To: Richard Biener Cc: gcc-patches@gcc.gnu.org Subject: [PATCH] testsuite: Fix up pr113617 test for darwin [PR113617] Message-ID: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_NONE, 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: Jakub Jelinek Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Hi! The test attempts to link a shared library, and apparently Darwin doesn't allow by default for shared libraries to contain undefined symbols. The following patch just adds dummy definitions for the symbols, so that the library no longer has any undefined symbols at least in my linux testing. Furthermore, for target { !shared } targets (like darwin until the it is fixed in target-supports.exp), because we then link a program rather than shared library, the patch also adds a dummy main definition so that it can link. Regtested on x86_64-linux and i686-linux, ok for trunk? 2024-03-08 Jakub Jelinek PR rtl-optimization/113617 * g++.dg/other/pr113617.C: Define -DSHARED when linking with -shared. * g++.dg/other/pr113617-aux.cc: Add definitions for used methods and templates not defined elsewhere. Jakub --- gcc/testsuite/g++.dg/other/pr113617.C.jj 2024-02-26 17:54:57.054857411 +0100 +++ gcc/testsuite/g++.dg/other/pr113617.C 2024-03-07 15:57:40.510796110 +0100 @@ -2,7 +2,7 @@ // { dg-do link { target c++11 } } // { dg-options "-O2" } // { dg-additional-options "-fPIC" { target fpic } } */ -// { dg-additional-options "-shared" { target shared } } */ +// { dg-additional-options "-shared -DSHARED" { target shared } } */ // { dg-additional-sources pr113617-aux.cc } #include "pr113617.h" --- gcc/testsuite/g++.dg/other/pr113617-aux.cc.jj 2024-02-26 17:54:57.054857411 +0100 +++ gcc/testsuite/g++.dg/other/pr113617-aux.cc 2024-03-07 15:58:05.473448950 +0100 @@ -7,3 +7,42 @@ void qux() { A a; a.foo(0, 0); } + +namespace R { +template<> +Y >::AI +Y >::operator->() +{ + return AI(); +} +template<> +Y >::AI +Y >::operator->() +{ + return AI(); +} +} + +N1::N2::N3::AB ab; + +N1::N2::N3::AB & +N1::N2::N3::AB::bleh() +{ + return ab; +} + +N1::N2::N3::AC::AC(int) +{ +} + +void +N1::N2::N3::AC::m1(R::S) +{ +} + +#ifndef SHARED +int +main() +{ +} +#endif