On Fri, Apr 25, 2014 at 12:47:32PM +0200, Eric Botcazou wrote:
> /* PR target/60941 */
> /* Reported by Martin Husemann <[email protected]> */
>
> extern void abort (void);
>
> static void __attribute__((noinline))
> set (unsigned long *l)
> {
> *l = 31;
> }
>
> int main (void)
> {
> unsigned long l;
> int i;
>
> set (&l);
> i = (int) l;
> l = (unsigned long)(2U << i);
> if (l != 0)
> abort ();
> return 0;
> }
I'm afraid the testcase will fail on int16 targets, so perhaps
you should guard the body of main other than return 0; with
#if __INT_MAX__ >= 2147483647ULL
or
#if __SIZEOF_INT__ >= 4
or similar (or require int32plus target, but gcc.c-torture/execute/
is not a good place for that and *.x files are terribly ugly, so
better would be to move the test to gcc.dg/torture/ in that case).
Jakub