From patchwork Tue Nov 28 12:26:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rainer Orth X-Patchwork-Id: 80909 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 313F63845BFA for ; Tue, 28 Nov 2023 12:26:51 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp.CeBiTec.Uni-Bielefeld.DE (smtp.CeBiTec.Uni-Bielefeld.DE [129.70.160.84]) by sourceware.org (Postfix) with ESMTPS id A2C5D3858C50 for ; Tue, 28 Nov 2023 12:26:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A2C5D3858C50 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=CeBiTec.Uni-Bielefeld.DE Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=cebitec.uni-bielefeld.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org A2C5D3858C50 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=129.70.160.84 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701174395; cv=none; b=QtqzrhHe7nlCBGFnZ5eqR4MfbxVwVK/q3dNNvQUGoBKYzyFbVXu8ZGQV2O6uf4vSGWgbKM/1fgGMEtuM+IfUEVqSbXuMdijDiErseGdM21qfrV6x2USRG2xT2WbnwCzE7N7XMRSKkjs5avWCwsW6dS2i2HyPc6GdPNQL6dQlSjY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701174395; c=relaxed/simple; bh=UyV5nvMKq6kKM781NrRdOsEdV/fbkCrApn/r9/6Hiho=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=oWKYOeMNcUQ2uQ3cs9aRGa+/1KRPf/d4cu085Sme38z0D5QHhbR+4korEZ0tDbOhwGiO9H2vKN2OFdnd4tHmWhFNRYvhsh6lfF8voH7DW/uaaCLq8jVCRStEk66zzq3vlx4FOxLC6Syr7BtWHY0/4wVdfQtk7bidkAPjo8LfP2k= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from localhost (localhost [127.0.0.1]) by smtp.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id 7EB67C036B; Tue, 28 Nov 2023 13:26:32 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d= cebitec.uni-bielefeld.de; h=content-type:content-type :mime-version:user-agent:message-id:date:date:subject:subject :from:from:received:received; s=20200306; t=1701174390; bh=UyV5n vMKq6kKM781NrRdOsEdV/fbkCrApn/r9/6Hiho=; b=OxhTqCWu0ScTq2HPOOsEh vzCFYabt9Jc/7Rl9iRY9P6kUYL3lzvU76gfae8bba2kss0i7SC7Ug8MEiRtTU75i vJELc/78WYl9e0fRV1KPLtV/wiLzpU4OX/DKTDpMS8MMsKmPDWYQye2MIwYub7BC ffB1Ri6RnaJbmw5Z+QFaGNDt1/l+QyeZZRjfflxrJaBQrOrvplLCZD+nizZJwmwC I/LWiRpxc+zdfhvENmsPD+Xio1hsOBuH/DQyd+ptqxanUpV/FSfBqsCPDqEYeTQL vJjJwzYJKJiQLpWJtkE6kCPq89GyjHRpDUgrobkXQ3ZVL7R/Q4s3PKzO5LcYRfti Q== X-Virus-Scanned: amavisd-new at cebitec.uni-bielefeld.de Received: from smtp.CeBiTec.Uni-Bielefeld.DE ([127.0.0.1]) by localhost (smtp.cebitec.uni-bielefeld.de [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id uuRP-yV4q8XO; Tue, 28 Nov 2023 13:26:30 +0100 (CET) Received: from manam.CeBiTec.Uni-Bielefeld.DE (p4fddb508.dip0.t-ipconnect.de [79.221.181.8]) (Authenticated sender: ro) by smtp.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTPSA id C6CBBC0463; Tue, 28 Nov 2023 13:26:30 +0100 (CET) From: Rainer Orth To: gcc-patches@gcc.gnu.org Cc: Hongyu Wang , Jakub Jelinek Subject: [PATCH] testsuite, i386: Only check for cfi directives if supported [PR112729] Date: Tue, 28 Nov 2023 13:26:30 +0100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1.90 (usg-unix-v) MIME-Version: 1.0 X-Spam-Status: No, score=-3791.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, GIT_PATCH_0, KAM_SHORT, SPF_HELO_NONE, SPF_PASS, 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: , Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org gcc.target/i386/apx-interrupt-1.c and two more tests FAIL on Solaris/x86 with the native assembler. Like Darwin as, it doesn't support cfi directives. Instead of adding more and more targets in every affected test, this patch introduces a cfi effective-target keyword to check for the prerequisite. Tested on i386-pc-solaris2.11 (as and gas), x86_64-pc-linux-gnu, and x86_64-apple-darwin23.1.0. Any comments on the CFI detection in target-supports.exp? Otherwise, I'll commit the patch as is. The tests still FAIL on Solaris/x86 and FreeBSD/x86_64 with gas due to their -fno-omit-frame-pointer default; this will be addressed separately. Thanks. Raine # HG changeset patch # Parent 4c217a4922ab8f91e45518fef88ad562f71fc0a5 testsuite, i386: Only check for cfi directives if supported diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi --- a/gcc/doc/sourcebuild.texi +++ b/gcc/doc/sourcebuild.texi @@ -2671,6 +2671,9 @@ The language for the compiler under test @item c99_runtime Target provides a full C99 runtime. +@item cfi +Target supports DWARF CFI directives. + @item correct_iso_cpp_string_wchar_protos Target @code{string.h} and @code{wchar.h} headers provide C++ required overloads for @code{strchr} etc. functions. diff --git a/gcc/testsuite/gcc.target/i386/apx-interrupt-1.c b/gcc/testsuite/gcc.target/i386/apx-interrupt-1.c --- a/gcc/testsuite/gcc.target/i386/apx-interrupt-1.c +++ b/gcc/testsuite/gcc.target/i386/apx-interrupt-1.c @@ -1,6 +1,5 @@ -/* { dg-do compile { target { ! ia32 } } } */ +/* { dg-do compile { target { { ! ia32 } && cfi } } } */ /* { dg-options "-mapx-features=egpr -m64 -O2 -mgeneral-regs-only -mno-cld -mno-push-args -maccumulate-outgoing-args" } */ -/* { dg-skip-if "does not emit .cfi_xxx" "*-*-darwin*" } */ extern void foo (void *) __attribute__ ((interrupt)); extern int bar (int); diff --git a/gcc/testsuite/gcc.target/i386/apx-push2pop2-1.c b/gcc/testsuite/gcc.target/i386/apx-push2pop2-1.c --- a/gcc/testsuite/gcc.target/i386/apx-push2pop2-1.c +++ b/gcc/testsuite/gcc.target/i386/apx-push2pop2-1.c @@ -1,6 +1,5 @@ -/* { dg-do compile { target { ! ia32 } } } */ +/* { dg-do compile { target { { ! ia32 } && cfi } } } */ /* { dg-options "-O2 -mapx-features=push2pop2" } */ -/* { dg-skip-if "does not emit .cfi_xxx" "*-*-darwin*" } */ extern int bar (int); diff --git a/gcc/testsuite/gcc.target/i386/apx-push2pop2_force_drap-1.c b/gcc/testsuite/gcc.target/i386/apx-push2pop2_force_drap-1.c --- a/gcc/testsuite/gcc.target/i386/apx-push2pop2_force_drap-1.c +++ b/gcc/testsuite/gcc.target/i386/apx-push2pop2_force_drap-1.c @@ -1,6 +1,5 @@ -/* { dg-do compile { target { ! ia32 } } } */ +/* { dg-do compile { target { { ! ia32 } && cfi } } } */ /* { dg-options "-O2 -mapx-features=push2pop2 -mforce-drap" } */ -/* { dg-skip-if "does not emit .cfi_xxx" "*-*-darwin*" } */ #include "apx-push2pop2-1.c" diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -10082,6 +10082,18 @@ proc check_effective_target_c99_runtime }] } +# Return 1 if the target supports DWARF CFI directives. + +proc check_effective_target_cfi { } { + return [check_no_compiler_messages cfi assembly { + #ifdef __GCC_HAVE_DWARF2_CFI_ASM + /* ok */ + #else + #error unsupported + #endif + } ""] +} + # Return 1 if the target provides the D runtime. proc check_effective_target_d_runtime { } {