OSDN Git Service

Backported from mainline
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.c-torture / execute / 20040218-1.c
1 /* PR target/14209.  Bug in cris.md, shrinking access size of
2    postincrement.
3    Origin: <hp@axis.com>.  */
4
5 long int xb (long int *y) __attribute__ ((__noinline__));
6 long int xw (long int *y) __attribute__ ((__noinline__));
7 short int yb (short int *y) __attribute__ ((__noinline__));
8
9 long int xb (long int *y)
10 {
11   long int xx = *y & 255;
12   return xx + y[1];
13 }
14
15 long int xw (long int *y)
16 {
17   long int xx = *y & 65535;
18   return xx + y[1];
19 }
20
21 short int yb (short int *y)
22 {
23   short int xx = *y & 255;
24   return xx + y[1];
25 }
26
27 int main (void)
28 {
29   long int y[] = {-1, 16000};
30   short int yw[] = {-1, 16000};
31
32   if (xb (y) != 16255
33       || xw (y) != 81535
34       || yb (yw) != 16255)
35     abort ();
36   exit (0);
37 }