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.
@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.
}]
}
+# Return true if sleep is supported on the target.
+
+proc check_effective_target_sleep { } {
+ return [check_no_compiler_messages sleep executable {
+ #include <unistd.h>
+ 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 {