OSDN Git Service

* gcc.c-torture/execute/20020619-1.c: Correct for targets without 32 bit int.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.c-torture / execute / pr7284-1.c
1 /* Signed left-shift is implementation-defined in C89 (and see
2    DR#081), not undefined.  Bug 7284 from Al Grant (AlGrant at
3    myrealbox.com).  */
4
5 /* { dg-options "-std=c89" } */
6
7 extern void abort (void);
8 extern void exit (int);
9
10 int
11 f (int n)
12 {
13   return (n << 24) / (1 << 23);
14 }
15
16 volatile int x = 128;
17
18 int
19 main (void)
20 {
21   if (f(x) != -256)
22     abort ();
23   exit (0);
24 }