From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) by sourceware.org (Postfix) with ESMTP id 541573861930 for ; Tue, 30 Jun 2020 15:04:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 541573861930 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-426-WaVj2TlbMsS6mskglDV9AQ-1; Tue, 30 Jun 2020 11:03:22 -0400 X-MC-Unique: WaVj2TlbMsS6mskglDV9AQ-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 680F3855AA8 for ; Tue, 30 Jun 2020 15:03:11 +0000 (UTC) Received: from blade.nx (ovpn-114-100.ams2.redhat.com [10.36.114.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 15887741B3 for ; Tue, 30 Jun 2020 15:03:11 +0000 (UTC) Received: from blade.com (localhost [127.0.0.1]) by blade.nx (Postfix) with ESMTP id 4C652816CCA9 for ; Tue, 30 Jun 2020 16:03:07 +0100 (BST) From: Gary Benson To: gdb-patches@sourceware.org Subject: [PATCH] Skip tests requiring "alignof (void)" when compiling using clang Date: Tue, 30 Jun 2020 16:03:00 +0100 Message-Id: <1593529380-8689-1-git-send-email-gbenson@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-14.9 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_H3, 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: Tue, 30 Jun 2020 15:04:06 -0000 Hi all, Clang fails to compile the generated output of gdb.cp/align.exp with the following error: invalid application of 'alignof' to an incomplete type 'void'. This patch adds preprocessor conditionals to the generated output, to avoid the offending code, and causes the tests that require it to be skipped. Checked on Fedora 31 x86_64, GCC and clang. Ok to commit? Cheers, Gary -- gdb/testsuite/ChangeLog: * gdb.cp/align.exp: Skip tests requiring "alignof (void)" when compiling using clang. --- gdb/testsuite/ChangeLog | 5 +++++ gdb/testsuite/gdb.cp/align.exp | 9 +++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/gdb/testsuite/gdb.cp/align.exp b/gdb/testsuite/gdb.cp/align.exp index 0905a27..65ffb3b 100644 --- a/gdb/testsuite/gdb.cp/align.exp +++ b/gdb/testsuite/gdb.cp/align.exp @@ -80,7 +80,9 @@ puts $outfile { unsigned a_int3 = alignof (int[3]); +#if !defined(__clang__) unsigned a_void = alignof (void); +#endif struct base { char c; }; struct derived : public virtual base { int i; }; @@ -170,5 +172,8 @@ foreach type $typelist { set expected [get_integer_valueof a_int3 0] gdb_test "print alignof(int\[3\])" " = $expected" -set expected [get_integer_valueof a_void 0] -gdb_test "print alignof(void)" " = $expected" + +if ![test_compiler_info clang*] { + set expected [get_integer_valueof a_void 0] + gdb_test "print alignof(void)" " = $expected" +} -- 1.8.3.1