testsuite: Add -mbig-endian stdint.h requirement

Some AArch64 tests force -mbig-endian and indirectly include stdint.h.
However, not all OSes support both endiannesses, leading to:

FAIL: gcc.target/aarch64/advsimd-intrinsics/bf16_get-be.c   -O0  (test for excess errors)
UNRESOLVED: gcc.target/aarch64/advsimd-intrinsics/bf16_get-be.c   -O1   check-function-bodies test_vget_high_bf16
UNRESOLVED: gcc.target/aarch64/advsimd-intrinsics/bf16_get-be.c   -O1   check-function-bodies test_vget_low_bf16

etc.  This patch adds an (admittedly special-purpose) target
selector for this.

gcc/
	* doc/sourcebuild.texi (stdint_types_mbig_endian): Document.

gcc/testsuite/
	* lib/target-supports.exp
	(check_effective_target_stdint_types_mbig_endian): New proc.
	* gcc.target/aarch64/advsimd-intrinsics/bf16_get-be.c: Require
	stdint_types_mbig_endian.
	* gcc.target/aarch64/advsimd-intrinsics/bfdot-2.c: Likewise.
	* gcc.target/aarch64/advsimd-intrinsics/vdot-3-2.c: Likewise.
This commit is contained in:
Richard Sandiford 2021-04-08 17:39:11 +01:00
parent 5240c5ca2e
commit 09ef422fad
5 changed files with 19 additions and 0 deletions

View File

@ -2447,6 +2447,10 @@ Target has the basic signed and unsigned C types in @code{stdint.h}.
This will be obsolete when GCC ensures a working @code{stdint.h} for
all targets.
@item stdint_types_mbig_endian
Target accepts the option @option{-mbig-endian} and @code{stdint.h}
can be included without error when @option{-mbig-endian} is passed.
@item stpcpy
Target provides @code{stpcpy} function.

View File

@ -1,4 +1,5 @@
/* { dg-do assemble { target { aarch64*-*-* } } } */
/* { dg-require-effective-target stdint_types_mbig_endian } */
/* { dg-require-effective-target arm_v8_2a_bf16_neon_ok } */
/* { dg-add-options arm_v8_2a_bf16_neon } */
/* { dg-additional-options "-mbig-endian -save-temps" } */

View File

@ -1,4 +1,5 @@
/* { dg-do assemble { target { aarch64*-*-* } } } */
/* { dg-require-effective-target stdint_types_mbig_endian } */
/* { dg-require-effective-target arm_v8_2a_bf16_neon_ok } */
/* { dg-add-options arm_v8_2a_bf16_neon } */
/* { dg-additional-options "-mbig-endian --save-temps" } */

View File

@ -1,4 +1,5 @@
/* { dg-do assemble { target { aarch64*-*-* } } } */
/* { dg-require-effective-target stdint_types_mbig_endian } */
/* { dg-require-effective-target arm_v8_2a_i8mm_ok } */
/* { dg-add-options arm_v8_2a_i8mm } */
/* { dg-additional-options "-mbig-endian -save-temps" } */

View File

@ -8254,6 +8254,18 @@ proc check_effective_target_stdint_types { } {
}]
}
# Like check_effective_target_stdint_types, but test what happens when
# -mbig-endian is passed. This test only makes sense on targets that
# support -mbig-endian; it will fail elsewhere.
proc check_effective_target_stdint_types_mbig_endian { } {
return [check_no_compiler_messages stdint_types_mbig_endian assembly {
#include <stdint.h>
int8_t a; int16_t b; int32_t c; int64_t d;
uint8_t e; uint16_t f; uint32_t g; uint64_t h;
} "-mbig-endian"]
}
# Return 1 if target has the basic signed and unsigned types in
# <inttypes.h>, 0 otherwise. This is for tests that GCC's notions of
# these types agree with those in the header, as some systems have