From patchwork Fri Dec 13 21:27:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Fran=C3=A7ois_Dumont?= X-Patchwork-Id: 1209463 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-515971-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="pqyecudg"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="ZljRgdo9"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47ZP024sxkz9sP3 for ; Sat, 14 Dec 2019 08:27:44 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=I8ZJ3ZA5HTVCLfe+2CiMnFP5HuYpfS5i55z8Y+5yPIikbZaZf4 /4ZK/obQCp8Up2lbOezGa3e53IHDMieXNNMI8STWRtd2r0SK65tDxlJgiImjYHdD ilycXGfSlHwGKX8ZqnXsUMv3oOpNvuVkhF8TDYlpIL0vQM8FmoMMWyCJM= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; s= default; bh=PyJtjaDqseTZzIAdRRu3y8hp9aE=; b=pqyecudgfaNzbTOgldiJ HIdDncO3m5ZVJYcq8jixSCZ2H9vrEKZLhWmZPLA1maqTCs0XSZV9fvSnPvZeptIl rQYv4iqM8zE7y2G0RpMS5GNoJ2Jfg5Zf44+mXo2+J7nUST+SJpb1APeCyyaZzifG P5PsYkxVzfp2G+Md0YK/6PM= Received: (qmail 13623 invoked by alias); 13 Dec 2019 21:27:30 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 13594 invoked by uid 89); 13 Dec 2019 21:27:29 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=mit, sit, HX-Received:cc11 X-HELO: mail-wm1-f53.google.com Received: from mail-wm1-f53.google.com (HELO mail-wm1-f53.google.com) (209.85.128.53) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 13 Dec 2019 21:27:26 +0000 Received: by mail-wm1-f53.google.com with SMTP id d5so228725wmb.4; Fri, 13 Dec 2019 13:27:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:from:subject:message-id:date:user-agent:mime-version :content-language; bh=bubjLBmlW7WMc3/3+vbvpGSzNLu3mRrBaPSMCOI7EVU=; b=ZljRgdo9rG6V94LVc+FVmKXTv7F4fe5onFGhBplIDSsN2toEqm1/9L6pjq/t7a+Asu ahqO+Htdm9YBCcQftio4ZjC+7rM6JJwK3Zo8PHxNEV/pwU8z64L2N7wUv5Ps/5Uv9Ile 6xOV1sz2eMIZJlbBOHMAncpaL9dAEaRuPSMTlSb7eWppDFG59tXAV1ekVdnBJ0yUjleO Es2rLLba1ycrq6+7YbtAHgvTRAqMd3cx2+CeXuWPVQJgy6l1N7OxVIEdcVFBJepwzrn/ fvOPJWUr08ipUO9w+pcVx/VJKyZpKf7eCcVPh/aHnSw09SywmKr6Za1554ReXk0KIPf0 XcTw== Received: from ?IPv6:2a01:e0a:1dc:b1c0:64d8:e700:dab3:4e5c? ([2a01:e0a:1dc:b1c0:64d8:e700:dab3:4e5c]) by smtp.googlemail.com with ESMTPSA id o185sm11510779wmb.40.2019.12.13.13.27.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 13 Dec 2019 13:27:23 -0800 (PST) To: "libstdc++@gcc.gnu.org" , gcc-patches From: =?utf-8?q?Fran=C3=A7ois_Dumont?= Subject: [PATCH] Fix pretty printers tests Message-ID: Date: Fri, 13 Dec 2019 22:27:22 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.1 MIME-Version: 1.0 Here is a patch to fix prettyprinters.exp failures in normal and debug modes. In 80276.cc I replicate the #define with comment from other tests even if it isn't true that cxx11 abi string isn't supported. It's just that it doesn't appear as 'std::string', the aliasing doesn't work. I still have failures when running with versioned namespace which I am going to check now.     * python/libstdcxx/v6/printers.py (lookup_node_type): Remove redundant     call to lookup_node_type.     * testsuite/libstdc++-prettyprinters/80276.cc: Define     _GLIBCXX_USE_CXX11_ABI to 0.     * testsuite/libstdc++-prettyprinters/91997.cc: Use regexp-test to check     'a' content. Ok to commit ? François diff --git a/libstdc++-v3/python/libstdcxx/v6/printers.py b/libstdc++-v3/python/libstdcxx/v6/printers.py index 08327516b28..5119e6fab7e 100644 --- a/libstdc++-v3/python/libstdcxx/v6/printers.py +++ b/libstdc++-v3/python/libstdcxx/v6/printers.py @@ -146,7 +146,6 @@ def lookup_node_type(nodename, containertype): if is_member_of_namespace(containertype, 'std::__cxx1998', 'std::__debug', '__gnu_debug'): nodename = nodename.replace('::', '::__cxx1998::', 1) - return lookup_templ_spec(nodename, valtype) try: return lookup_templ_spec(nodename, valtype) except gdb.error: diff --git a/libstdc++-v3/testsuite/libstdc++-prettyprinters/80276.cc b/libstdc++-v3/testsuite/libstdc++-prettyprinters/80276.cc index 3425b499e3a..272adb86e0c 100644 --- a/libstdc++-v3/testsuite/libstdc++-prettyprinters/80276.cc +++ b/libstdc++-v3/testsuite/libstdc++-prettyprinters/80276.cc @@ -18,6 +18,9 @@ // with this library; see the file COPYING3. If not see // . +// Type printers only recognize the old std::string for now. +#define _GLIBCXX_USE_CXX11_ABI 0 + #include #include #include diff --git a/libstdc++-v3/testsuite/libstdc++-prettyprinters/91997.cc b/libstdc++-v3/testsuite/libstdc++-prettyprinters/91997.cc index 393c5680e2e..059ac9aa97f 100644 --- a/libstdc++-v3/testsuite/libstdc++-prettyprinters/91997.cc +++ b/libstdc++-v3/testsuite/libstdc++-prettyprinters/91997.cc @@ -41,7 +41,7 @@ int main() // { dg-final { note-test mit {{first = 1, second = 2}} } } std::any a = m; - // { dg-final { note-test a {std::any containing std::map with 1 element = {[1] = 2}} } } + // { dg-final { regexp-test a {std::any containing std::(__debug::)?map with 1 element = {\[1\] = 2}} } } std::set s{1, 2}; auto sit = s.begin();