From patchwork Mon Dec 11 19:10:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Merrill X-Patchwork-Id: 176892 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp7281964vqy; Mon, 11 Dec 2023 11:16:13 -0800 (PST) X-Google-Smtp-Source: AGHT+IGXYJBmLPM+wci4LX/+2zMHlHDpJX86EK8n6EAnsHZk4x/OhXnaE9MqXEdLhz8ZmsGpZLf3 X-Received: by 2002:a67:c181:0:b0:464:375d:ddfa with SMTP id h1-20020a67c181000000b00464375dddfamr2010636vsj.15.1702322173514; Mon, 11 Dec 2023 11:16:13 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1702322173; cv=pass; d=google.com; s=arc-20160816; b=eJru9IE006eLecBFeW/dYUoRSEUitPXC1RYRnJ1Q+G8iH72T0xI2q54VB57MzVlOlK kZ9/2g8cGrIHsoBdPNI2h+W8iB3nSXgsZ9lZytv1lQV+/yHmb/6jrTOlUt9fxrYSeIUV 53PeFwmdNkfY37tmNimcRCRM8gHsXC9Lo20z5ifPa9fm1yEUSTNGACIJGFfEQHKLj8OG PBP+bMJzPeXAiLIDGEvsWVU8e/Avh0Z9zdZCqR4elBoDqgZg5rNUahtz/Mm4U+jzj3Dy BdNljAPO6A1Ahx/E4GPlxDsjZXCxu0pUqIWR91A9MlWUZP5OHVSHe6GXxKvP07pHW/P0 AxIg== 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=i+KD0IyakFKnCKutX69A6CuD0OVm5xc7ktmcR85Bw+s=; fh=KcikgqRU6k+R2CrYuXIZ8xjv6AmTO7zbFdWYBhxPyTA=; b=PhFBLeXRTET6Hhh8nK1X3nvMn9ogIWgHRDZpvWkGFpAWkIuvSZepiP06pw3MIgBo6q ZouaOs5GUAFyDFIWgkX4DZFgaRVNKccCLdPVnym45of7+i4QcccmpvwHtwYzsfMrEwSE GCUPy/5yQjkXcwoF3593R4FBu6WSkmDePTBaq6kY0QmSdSa/7R+foKG3q/XSU854wXFF tr0sWTU4DqGubKSQk/hQqPk51qC0DQgCVRmUkzSG4M3FHjCT3yJEo9bwFz6dsgG43kEn UeDw2ip3NwSM0/+xh/huXMylStDcMtonWBk/7sl1kZZzh1OdGAB8YNyOpVxf3WIgQaH7 /JYw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=M3Hf3tPN; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id b7-20020a67fe87000000b004648441cc1csi1500190vsr.479.2023.12.11.11.16.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Dec 2023 11:16:13 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=M3Hf3tPN; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 360063858032 for ; Mon, 11 Dec 2023 19:16:13 +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 7D0AC3858D28 for ; Mon, 11 Dec 2023 19:15:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7D0AC3858D28 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 7D0AC3858D28 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=1702322150; cv=none; b=hn+5/qB7Wkfabo5u+EN1B+10yE9sc8Fy6aJx+ytK5VsXANkLWjlaLc0lx2Q7VeZa9miBNKBBJEklKw49wWjghziZ8xcZpTr9aHvutueaPGH5QoYZV4oTtyMgh4dSibD+XM03HXVDZ+UC5DJFv2VJ5pFrupk4of7MCWf2o1tCm2E= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1702322150; c=relaxed/simple; bh=QwWhXcF1MkMui1U0Ck6zUABdRUUXYnO6WlL6W7mtbRU=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=IHOSwG6VSo18+hul3jvZLY1hAOqyzt9+SQWu6zNX5V8Aj+ApD4lnl74LUJx+VnapsvU9Lf/OWFNtLZ5FxuhiQFFcXRwY3og16YWD1pDAXrjYjn6zqDx6aj7O9fqPePpMKsz7cKOiFg67jLUIV5qmr31TYfNufobCsZ9p+FTTfMk= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1702322148; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=i+KD0IyakFKnCKutX69A6CuD0OVm5xc7ktmcR85Bw+s=; b=M3Hf3tPNrQpJhfKQxMDWrkB838UNf7lE5bGmKrLYvEfJRaMi4vt6Om8127U5bLJWE83ndf QnIe9hiTzQ23lamsshXiCEcvLQ2zzWX1enRbe7VLQ6CqUwZZleZoihcIy9JK/zLyXqeil/ oX6rR3t1JRah2vX9PHoTm3bD3TAqMzc= Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-501-poqwiLljOdCMqlulC-Ub6g-1; Mon, 11 Dec 2023 14:15:47 -0500 X-MC-Unique: poqwiLljOdCMqlulC-Ub6g-1 Received: by mail-qv1-f72.google.com with SMTP id 6a1803df08f44-67aa6dd4e71so42147906d6.0 for ; Mon, 11 Dec 2023 11:15:47 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702321843; x=1702926643; 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=i+KD0IyakFKnCKutX69A6CuD0OVm5xc7ktmcR85Bw+s=; b=hHPdtooqR6X770maAd0a/2p0kXSpEok0TLTGOk6Mz6dxsWrjBuAEHpFzOg8zP0Oyck vpZdyBGj3TYgKqfYEKJnoYoylKCWm259VaYr9fJImjV4VeD0jEMB8skyUJTWLnndvasD fMdUUQzeVVmkLTY9cGSg599Mf0htPZ3x0cd82Ke5jmPTnpvV8TeKSVZ0JQOlKwvyxJd6 WnBShFDpPkAil+MJUykMZvHD1ox4z8rQZCzz80tRsfZKXTvy4M0fFuT/9MvLef2f74kh 0XBhDCkVLxABEbY9CM6RaStWpWUrObwoNY7Zx7IVDEW0097pzKXlsVQ97gpaa2sstKHN VEgQ== X-Gm-Message-State: AOJu0YxdvERSg1+kYIE3YqKtMNp0VAWiCxOYBBPOGCwvjCSE6zeSFnHl 7rV3zL5aZhhcK6wHXgBww9x5pa+ntMpO4EPZKQPvsgNoyiV8MWVb11V7mXTtr5I3nOulTf32F4u uvx29OYiG4LC1SxyCC4n71lexjHfVSRV9tXB1L0u6cMk1U8sOCJ6lDt9M70T8n9Rz8Gk42nfXeg == X-Received: by 2002:a05:6214:3004:b0:67a:a680:2871 with SMTP id ke4-20020a056214300400b0067aa6802871mr3422849qvb.8.1702321842779; Mon, 11 Dec 2023 11:10:42 -0800 (PST) X-Received: by 2002:a05:6214:3004:b0:67a:a680:2871 with SMTP id ke4-20020a056214300400b0067aa6802871mr3422835qvb.8.1702321842399; Mon, 11 Dec 2023 11:10:42 -0800 (PST) Received: from jason.cygnus.csb (130-44-146-16.s12558.c3-0.arl-cbr1.sbo-arl.ma.cable.rcncustomer.com. [130.44.146.16]) by smtp.gmail.com with ESMTPSA id et12-20020a056214176c00b0067ad0ccae3csm3479295qvb.103.2023.12.11.11.10.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Dec 2023 11:10:42 -0800 (PST) From: Jason Merrill To: gcc-patches@gcc.gnu.org Cc: fxcoudert@gcc.gnu.org Subject: [pushed] testsuite: update mangling Date: Mon, 11 Dec 2023 14:10:39 -0500 Message-Id: <20231211191039.957070-1-jason@redhat.com> X-Mailer: git-send-email 2.39.3 MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.2 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, 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+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785014175866096920 X-GMAIL-MSGID: 1785014175866096920 Tested x86_64-pc-linux-gnu, applying to trunk. -- 8< -- Since r14-6064-gc3f281a0c1ca50 this test was checking for the wrong mangling, but it still passed on targets that support ABI compatibility aliases. Let's avoid generating those aliases when checking mangling. gcc/ChangeLog: * common.opt: Add comment. gcc/testsuite/ChangeLog: * g++.dg/cpp2a/concepts-explicit-inst1.C: Specify ABI v18. * g++.dg/cpp2a/concepts-explicit-inst1a.C: New test. --- gcc/common.opt | 1 + .../g++.dg/cpp2a/concepts-explicit-inst1.C | 1 + .../g++.dg/cpp2a/concepts-explicit-inst1a.C | 24 +++++++++++++++++++ 3 files changed, 26 insertions(+) create mode 100644 gcc/testsuite/g++.dg/cpp2a/concepts-explicit-inst1a.C base-commit: 889341a897d3d2e9fb09de1a1c5e764a2c03424f prerequisite-patch-id: 6f3182b395d62bae9a7b1930edc21d52611c328c diff --git a/gcc/common.opt b/gcc/common.opt index 5eb5ecff04b..d263a959df3 100644 --- a/gcc/common.opt +++ b/gcc/common.opt @@ -1020,6 +1020,7 @@ Driver Undocumented ; ; 19: Emits ABI tags if needed in structured binding mangled names. ; Ignores cv-quals on [[no_unique_object]] members. +; Mangles constraints on function templates. ; Default in G++ 14. ; ; Additional positive integers will be assigned as new versions of diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-explicit-inst1.C b/gcc/testsuite/g++.dg/cpp2a/concepts-explicit-inst1.C index 5cbf64a8cd3..b66e919e880 100644 --- a/gcc/testsuite/g++.dg/cpp2a/concepts-explicit-inst1.C +++ b/gcc/testsuite/g++.dg/cpp2a/concepts-explicit-inst1.C @@ -1,4 +1,5 @@ // { dg-do compile { target c++20 } } +// { dg-additional-options "-fabi-version=18 -fabi-compat-version=18" } // { dg-final { scan-assembler "_Z1gI1XEvT_" } } // { dg-final { scan-assembler "_Z1gI1YEvT_" } } // { dg-final { scan-assembler "_Z1gIiEvT_" } } diff --git a/gcc/testsuite/g++.dg/cpp2a/concepts-explicit-inst1a.C b/gcc/testsuite/g++.dg/cpp2a/concepts-explicit-inst1a.C new file mode 100644 index 00000000000..feb31f9e24c --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp2a/concepts-explicit-inst1a.C @@ -0,0 +1,24 @@ +// { dg-do compile { target c++20 } } +// { dg-additional-options "-fabi-version=0 -fabi-compat-version=0" } +// { dg-final { scan-assembler "_Z1gITk1C1YEvT_" } } +// { dg-final { scan-assembler "_Z1gITk1D1XEvT_" } } +// { dg-final { scan-assembler "_Z1gIiEvT_" } } + +template + concept C = __is_class(T); + +template + concept D = C && __is_empty(T); + +struct X { }; +struct Y { int n; }; + +template void g(T) { } // #1 +template void g(T) { } // #2 +template void g(T) { } // #3 + +template void g(int); // Instantiate #1 +template void g(X); // Instantitae #3 +template void g(Y); // Instantiate #2 + +int main() { }