struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-20040218-1.c
blobe6463d84b2c314312ac2bc9d96acaa8466b3f81a
1 /*
2 20040218-1.c from the execute part of the gcc torture suite.
3 */
5 #include <testfwk.h>
7 #ifdef __SDCC
8 #pragma std_c99
9 #endif
11 /* PR target/14209. Bug in cris.md, shrinking access size of
12 postincrement.
13 Origin: <hp@axis.com>. */
15 long int xb (long int *y);
16 long int xw (long int *y);
17 short int yb (short int *y);
19 long int xb (long int *y)
21 long int xx = *y & 255;
22 return xx + y[1];
25 long int xw (long int *y)
27 long int xx = *y & 65535;
28 return xx + y[1];
31 short int yb (short int *y)
33 short int xx = *y & 255;
34 return xx + y[1];
37 void testTortureExecute (void)
39 long int y[] = {-1, 16000};
40 short int yw[] = {-1, 16000};
42 if (xb (y) != 16255
43 || xw (y) != 81535
44 || yb (yw) != 16255)
45 ASSERT (0);
46 return;