diff options
author | Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> | 2023-11-29 14:52:04 +0100 |
---|---|---|
committer | Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> | 2023-11-29 14:52:04 +0100 |
commit | 8ee480441eaec87ca6e0b0963fe9aade7edd1e8a (patch) | |
tree | 724de5e61b6f3cfeb5a9bdad5b60e34c0e913a08 /gcc | |
parent | 58baac57d6f3c0f723c1fd6ae338752e73e42934 (diff) | |
download | gcc-8ee480441eaec87ca6e0b0963fe9aade7edd1e8a.zip gcc-8ee480441eaec87ca6e0b0963fe9aade7edd1e8a.tar.gz gcc-8ee480441eaec87ca6e0b0963fe9aade7edd1e8a.tar.bz2 |
testsuite, i386: Only check for cfi directives if supported [PR112729]
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.
2023-11-24 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
gcc/testsuite:
PR testsuite/112729
* lib/target-supports.exp (check_effective_target_cfi): New proc.
* gcc.target/i386/apx-interrupt-1.c: Require cfi instead of
skipping on *-*-darwin*.
* gcc.target/i386/apx-push2pop2_force_drap-1.c: Likewise.
* gcc.target/i386/apx-push2pop2-1.c: Likewise.
gcc:
PR testsuite/112729
* doc/sourcebuild.texi (Effective-Target Keywords, Environment
attributes): Document cfi.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/doc/sourcebuild.texi | 3 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/i386/apx-interrupt-1.c | 3 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/i386/apx-push2pop2-1.c | 3 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/i386/apx-push2pop2_force_drap-1.c | 3 | ||||
-rw-r--r-- | gcc/testsuite/lib/target-supports.exp | 12 |
5 files changed, 18 insertions, 6 deletions
diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi index e27e0fa..fbd45b5 100644 --- a/gcc/doc/sourcebuild.texi +++ b/gcc/doc/sourcebuild.texi @@ -2671,6 +2671,9 @@ The language for the compiler under test is C++. @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 index 6844e57..fefe2e6 100644 --- 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 -fomit-frame-pointer" } */ -/* { 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 index 5f43b42..06a7c0d 100644 --- 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 -fomit-frame-pointer" } */ -/* { 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 index 4e2259f..7e86e15 100644 --- 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 -fomit-frame-pointer -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 index a722335..8d87403 100644 --- 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 { } { |