Message ID | A614194ED15B4844BC4C9FB7F21FCD92704562D8@hhmail02.hh.imgtec.org |
---|---|
State | New |
Headers | show |
Hi Toma, > As you suggested, I have added a check_gettimeofday_available proc in > target-supports.exp and a dg-require-gettimeofday proc in target-supports-dg.exp > which check for gettimeofday using the existing check_function_available proc. that's not what I suggested (or at least meant to suggest): having gettimeofday as an effective-target keyword (like setrlimit, mmap, and others) is the way to go, just your previous implementation of check_effective_target_gettimeofday was problematic/unreliable. If you go this route, there's no need to modify target-supports-dg.exp at all. Besides: I forget to mention that new effective-target keywords need to be documented in sourcebuild.texi. Sorry for the confusion. Rainer
diff --git a/gcc/testsuite/gcc.dg/lto/pr60449_0.c b/gcc/testsuite/gcc.dg/lto/pr60449_0.c index 5b878a6..2d3a900 100644 --- a/gcc/testsuite/gcc.dg/lto/pr60449_0.c +++ b/gcc/testsuite/gcc.dg/lto/pr60449_0.c @@ -1,5 +1,5 @@ /* { dg-lto-do link } */ -/* { dg-skip-if "Needs gettimeofday" { "avr-*-*" } } */ +/* { dg-require-gettimeofday "" } */ extern int printf (const char *__restrict __format, ...); typedef long int __time_t; diff --git a/gcc/testsuite/lib/target-supports-dg.exp b/gcc/testsuite/lib/target-supports-dg.exp index 6400d64..41369aa 100644 --- a/gcc/testsuite/lib/target-supports-dg.exp +++ b/gcc/testsuite/lib/target-supports-dg.exp @@ -236,6 +236,15 @@ proc dg-require-mkfifo { args } { } } +# If this target does not have gettimeofday, skip this test. + +proc dg-require-gettimeofday { args } { + if { ![check_gettimeofday_available] } { + upvar dg-do-what dg-do-what + set dg-do-what [list [lindex ${dg-do-what} 0] "N" "P"] + } +} + # If this target does not use __cxa_atexit, skip this test. proc dg-require-cxa-atexit { args } { diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 2766af4..9794383 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -2287,6 +2287,12 @@ proc check_mkfifo_available {} { return [check_function_available "mkfifo"] } +# Returns true iff "gettimeofday" is available on the target system. + +proc check_gettimeofday_available {} { + return [check_function_available "gettimeofday"] +} + # Returns true iff "__cxa_atexit" is used on the target system. proc check_cxa_atexit_available { } {