struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-20021010-2.c
blobefdc6f7a9f9a2eb93967b284378cb05a9f2e5427
1 /*
2 20021010-2.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 /* cse.c failure on x86 target.
12 Contributed by Stuart Hastings 10 Oct 2002 <stuart@apple.com> */
13 #include <stdlib.h>
15 typedef signed short SInt16;
17 typedef struct {
18 SInt16 minx;
19 SInt16 maxx;
20 SInt16 miny;
21 SInt16 maxy;
22 } IOGBounds;
24 int expectedwidth = 50;
26 unsigned int *global_vramPtr = (unsigned int __xdata *)0xa000;
28 IOGBounds global_bounds = { 100, 150, 100, 150 };
29 IOGBounds global_saveRect = { 75, 175, 75, 175 };
31 void
32 testTortureExecute (void)
34 #if 0 // TODO: enable when support for struct initialization is complete!
35 unsigned int *vramPtr;
36 int width;
37 IOGBounds saveRect = global_saveRect;
38 IOGBounds bounds = global_bounds;
40 if (saveRect.minx < bounds.minx) saveRect.minx = bounds.minx;
41 if (saveRect.maxx > bounds.maxx) saveRect.maxx = bounds.maxx;
43 vramPtr = global_vramPtr + (saveRect.miny - bounds.miny) ;
44 width = saveRect.maxx - saveRect.minx;
46 ASSERT (width == expectedwidth);
47 return;
48 #endif