This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
RE: [PATCH,testsuite] Skip gcc.dg/lto/pr60449_0.c for mips*-*-elf* targets.
- From: Toma Tabacu <Toma dot Tabacu at imgtec dot com>
- To: "Moore, Catherine" <Catherine_Moore at mentor dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Cc: Matthew Fortune <Matthew dot Fortune at imgtec dot com>
- Date: Wed, 1 Mar 2017 12:35:44 +0000
- Subject: RE: [PATCH,testsuite] Skip gcc.dg/lto/pr60449_0.c for mips*-*-elf* targets.
- Authentication-results: sourceware.org; auth=none
- References: <A614194ED15B4844BC4C9FB7F21FCD9270455FFB@hhmail02.hh.imgtec.org> <9ff301a4a1184abca09bc11af2cf2e16@SVR-ORW-MBX-04.mgc.mentorg.com>
> From: Catherine Moore
>
> Hi Toma,
> There are some MIPS ELF targets that do support gettimeofday. Perhaps you
> could handle this with a dg_require_effective_target entry for gettimeofday.
> Thanks,
> Catherine
>
Hi,
Thank you for your quick reply.
The patch below adds a dg_require_effective_target for gettimeofday.
Does it look good ? I'm having some doubts about the new directive's name.
Also, this patch makes the dg-skip-if for AVR redundant. Should I remove it ?
Regards,
Toma
gcc/testsuite/
* gcc.dg/lto/pr60449_0.c: Require gettimeofday support.
* lib/target-supports.exp (check_effective_target_gettimeofday): New.
diff --git a/gcc/testsuite/gcc.dg/lto/pr60449_0.c b/gcc/testsuite/gcc.dg/lto/pr60449_0.c
index 5b878a6..ad83938 100644
--- a/gcc/testsuite/gcc.dg/lto/pr60449_0.c
+++ b/gcc/testsuite/gcc.dg/lto/pr60449_0.c
@@ -1,5 +1,6 @@
/* { 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;
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index 2766af4..29d61ca 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -4342,6 +4342,32 @@ proc check_effective_target_mips_nanlegacy { } {
} "-mnan=legacy"]
}
+proc check_effective_target_gettimeofday { } {
+ return [check_no_compiler_messages gettimeofday executable {
+ struct timeval
+ {
+ long int tv_sec;
+ long int tv_usec;
+ };
+
+ struct timezone
+ {
+ int tz_minuteswest;
+ int tz_dsttime;
+ };
+
+ extern int gettimeofday (struct timeval * __tv, struct timezone * __tz);
+
+ int main ()
+ {
+ struct timeval tv;
+ struct timezone tz;
+ gettimeofday (&tv, &tz);
+ return 0;
+ }
+ }]
+}
+
# Return 1 if an MSA program can be compiled to object
proc check_effective_target_mips_msa { } {