From: Hans-Peter Nilsson Date: Thu, 23 Apr 2026 16:12:17 +0000 (+0200) Subject: testsuite: New effective-target sleep X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a1f70e4111ada4ece7a261a96c3dda1cca309171;p=thirdparty%2Fgcc.git testsuite: New effective-target sleep libgfortran calls sleep, which is not available on all targets. gcc: * doc/sourcebuild.texi (Effective-Target Keywords): Document 'sleep'. gcc/testsuite: * lib/target-supports.exp (check_effective_target_sleep): New. --- diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi index 3bccb1384d9..0bfcb96814d 100644 --- a/gcc/doc/sourcebuild.texi +++ b/gcc/doc/sourcebuild.texi @@ -2936,6 +2936,9 @@ Target can compile using @code{pthread.h} with no errors or warnings. @item pthread_h Target has @code{pthread.h}. +@item sleep +Target supports @code{sleep}. + @item sockets Target can compile using @code{sys/socket.h} with no errors or warnings. diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index e7165e2e1b8..9912c6df233 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -14823,6 +14823,17 @@ proc check_effective_target_alarm { } { }] } +# Return true if sleep is supported on the target. + +proc check_effective_target_sleep { } { + return [check_no_compiler_messages sleep executable { + #include + int main (void) { + sleep (1); + } + }] +} + # Return true if a speculation barrier is defined on the target. proc check_effective_target_speculation_barrier_defined { } { return [check_no_compiler_messages speculation_barrier_defined assembly {