Add check_effective_target_gettimeofday and use it in gcc.dg/lto/pr60449_0.c.
authorToma Tabacu <toma.tabacu@imgtec.com>
Mon, 6 Mar 2017 13:15:30 +0000 (13:15 +0000)
committerToma Tabacu <tomtab@gcc.gnu.org>
Mon, 6 Mar 2017 13:15:30 +0000 (13:15 +0000)
gcc/
* doc/sourcebuild.texi (Effective-Target Keywords, Environment
attributes): Document gettimeofday.

gcc/testsuite/

* gcc.dg/lto/pr60449_0.c: Add dg-require-effective-target for
gettimeofday.  Remove dg-skip-if for AVR.
* lib/target-supports.exp (check_effective_target_gettimeofday):
New proc.

From-SVN: r245921

gcc/ChangeLog
gcc/doc/sourcebuild.texi
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/lto/pr60449_0.c
gcc/testsuite/lib/target-supports.exp

index 1176ec3e4653e5cc6474b53c1bf73ddad2f17281..be8b6d9b673df5b6de48d42f28a219e560283705 100644 (file)
@@ -1,3 +1,8 @@
+2017-03-06  Toma Tabacu  <toma.tabacu@imgtec.com>
+
+       * doc/sourcebuild.texi (Effective-Target Keywords, Environment
+       attributes): Document gettimeofday.
+
 2017-03-06  Robin Dapp  <rdapp@linux.vnet.ibm.com>
 
        * config/s390/s390.c (s390_option_override_internal): Set
index 0dc434824b81cb0401fcc9fa6cead98412c7c82a..da17ff6759108b04da972d881c4a72e4eebc637c 100644 (file)
@@ -1914,6 +1914,9 @@ Target is @samp{freestanding} as defined in section 4 of the C99 standard.
 Effectively, it is a target which supports no extra headers or libraries
 other than what is considered essential.
 
+@item gettimeofday
+Target supports @code{gettimeofday}.
+
 @item init_priority
 Target supports constructors with initialization priority arguments.
 
index a6efef5e0b8a68ea02b7db4978530649a6869bf4..f90154a6fa69a996a08a729a2319f434e08d85a6 100644 (file)
@@ -1,3 +1,10 @@
+2017-03-06  Toma Tabacu  <toma.tabacu@imgtec.com>
+
+       * gcc.dg/lto/pr60449_0.c: Add dg-require-effective-target for
+       gettimeofday.  Remove dg-skip-if for AVR.
+       * lib/target-supports.exp (check_effective_target_gettimeofday):
+       New proc.
+
 2017-03-06  Robin Dapp  <rdapp@linux.vnet.ibm.com>
 
        * gcc.target/s390/hotpatch-1.c: Check for nopr %r0.
index 5b878a640dbac168b6b3268354879dda7075c77b..e6c3166e94a297559919909483f4274cd9def60d 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-lto-do link } */
-/* { dg-skip-if "Needs gettimeofday" { "avr-*-*" } } */
+/* { dg-require-effective-target gettimeofday } */
 
 extern int printf (const char *__restrict __format, ...);
 typedef long int __time_t;
index 2766af4f6794402cf541afe645fe95c3e3f4a2b5..d1639dc6701f793d0e999d074efe54179768b8ff 100644 (file)
@@ -968,6 +968,11 @@ proc check_effective_target_setrlimit {} {
     return [check_function_available "setrlimit"]
 }
 
+# Return 1 if the target supports gettimeofday, 0 otherwise.
+proc check_effective_target_gettimeofday {} {
+    return [check_function_available "gettimeofday"]
+}
+
 # Return 1 if the target supports swapcontext, 0 otherwise.
 proc check_effective_target_swapcontext {} {
     return [check_no_compiler_messages swapcontext executable {