This is the mail archive of the
mailing list for the GCC project.
Re: [Patch, testuite, committed] Fix some more tests that fail for non 32-bit int targets
- From: Mike Stump <mikestump at comcast dot net>
- To: Senthil Kumar Selvaraj <senthil_kumar dot selvaraj at atmel dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 25 Jul 2016 10:10:46 -0700
- Subject: Re: [Patch, testuite, committed] Fix some more tests that fail for non 32-bit int targets
- Authentication-results: sourceware.org; auth=none
- References: <firstname.lastname@example.org>
On Jul 25, 2016, at 5:00 AM, Senthil Kumar Selvaraj <email@example.com> wrote:
> The below patch fixes tests that fail for the avr target, because they
> assume ints are atleast 32 bits wide and pointers and longs have the
> same size.
> I've required int32plus support for one test, and for the other two,
> I've introduced a cast to intptr_t to avoid the pointer <-> int size
> difference warning.
> Reg tested on avr and x86_64 with no regressions. Committed as
Can you use __INTPTR_TYPE__ instead? This way, you don't need to add any include, and the test case will work in cross environments without any libc, which is at times handy. Thanks.
See grep INTPTR gcc/gcc/testsuite/gcc.dg/*.c for how people use it, and for the unsigned version.
> 2016-07-25 Senthil Kumar Selvaraj <firstname.lastname@example.org>
> * gcc.dg/torture/pr69352.c (foo): Cast to intptr_t instead of long.
> * gcc.dg/torture/pr69771.c: Require int32plus.
> * gcc.dg/torture/pr71866.c (inb): Add cast to intptr_t.