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: Rainer Orth <ro at CeBiTec dot Uni-Bielefeld dot DE>
- To: Toma Tabacu <Toma dot Tabacu at imgtec dot com>
- Cc: "Moore\, Catherine" <Catherine_Moore at mentor dot com>, "gcc-patches\@gcc.gnu.org" <gcc-patches at gcc dot gnu dot org>, Matthew Fortune <Matthew dot Fortune at imgtec dot com>
- Date: Wed, 01 Mar 2017 13:53:30 +0100
- 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> <A614194ED15B4844BC4C9FB7F21FCD927045624F@hhmail02.hh.imgtec.org>
Hi Toma,
> 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.
no, this has a couple of problems. See below.
> Also, this patch makes the dg-skip-if for AVR redundant. Should I remove it ?
Of course: no reason to duplicate this, this would just be confusing.
> 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 { } {
This proc needs a comment like all the others.
> + 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;
> + }
> + }]
> +}
This is very wrong: some targets use a void * second arg, and other
types for the struct timeval members. Better use
check_function_available instead, as in several other examples. And
please test the testcase on at least one non-mips-elf target that
actually *has* gettimeofday.
Rainer
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University