From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by sourceware.org (Postfix) with ESMTP id 958813857802 for ; Mon, 5 Oct 2020 13:44:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 958813857802 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-353-gW4MsRgRMK-767kA8YJTDQ-1; Mon, 05 Oct 2020 09:44:23 -0400 X-MC-Unique: gW4MsRgRMK-767kA8YJTDQ-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B2E3A802B46 for ; Mon, 5 Oct 2020 13:44:22 +0000 (UTC) Received: from blade.nx (ovpn-115-23.ams2.redhat.com [10.36.115.23]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7FB241C92B for ; Mon, 5 Oct 2020 13:44:22 +0000 (UTC) Received: from blade.com (localhost [127.0.0.1]) by blade.nx (Postfix) with ESMTP id ABB70816CD2E for ; Mon, 5 Oct 2020 14:44:21 +0100 (BST) From: Gary Benson To: gdb-patches@sourceware.org Subject: [PATCH] Fix gdb.base/list.exp with Clang Date: Mon, 5 Oct 2020 14:44:20 +0100 Message-Id: <1601905460-21628-1-git-send-email-gbenson@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="US-ASCII" X-Spam-Status: No, score=-13.0 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_H5, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 05 Oct 2020 13:44:26 -0000 Hi all, Two subtests of gdb.base/list.exp failed when built with Clang because the unused function "unused" was optimized out. This commit adds __attribute__ ((used)) to both definitions. Checked on Fedora 32 x86_64, with GCC and Clang. Ok to commit? Cheers, Gary --- gdb/testsuite/ChangeLog: * gdb.base/list0.c (unused): Add __attribute__ ((used)). * gdb.base/list1.c (unused): Likewise. --- gdb/testsuite/ChangeLog | 5 +++++ gdb/testsuite/gdb.base/list0.c | 2 +- gdb/testsuite/gdb.base/list1.c | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/gdb/testsuite/gdb.base/list0.c b/gdb/testsuite/gdb.base/list0.c index 0255cf3..1e5b7c1 100644 --- a/gdb/testsuite/gdb.base/list0.c +++ b/gdb/testsuite/gdb.base/list0.c @@ -36,7 +36,7 @@ int main () return 0; } -static void +static void __attribute__ ((used)) unused () { /* Not used for anything */ diff --git a/gdb/testsuite/gdb.base/list1.c b/gdb/testsuite/gdb.base/list1.c index a9f614f..d694495 100644 --- a/gdb/testsuite/gdb.base/list1.c +++ b/gdb/testsuite/gdb.base/list1.c @@ -12,7 +12,7 @@ void bar (int x) long_line (); } -static void +static void __attribute__ ((used)) unused () { /* Not used for anything */ -- 1.8.3.1