Pick three bugfixes from next branch to trunk for inclusion in 4.5.0 RC2, as discusse...
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-980223.c
blob42bd5688aa1e541e31cf227b64172e2f6a4b7298
1 /*
2 980223.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 // TODO: Enable when sdcc can return struct!
12 #if 0
13 typedef struct { char *addr; long type; } object;
15 object bar (object blah)
17 ASSERT(0);
20 object foo (object x, object y)
22 object z = *(object*)(x.addr);
23 if (z.type & 64)
25 y = *(object*)(z.addr+sizeof(object));
26 z = *(object*)(z.addr);
27 if (z.type & 64)
28 y = bar(y);
30 return y;
33 int nil;
34 object cons1[2] = { {(char *) &nil, 0}, {(char *) &nil, 0} };
35 object cons2[2] = { {(char *) &cons1, 64}, {(char *) &nil, 0} };
36 #endif
38 void
39 testTortureExecute (void)
41 #if 0
42 object x = {(char *) &cons2, 64};
43 object y = {(char *) &nil, 0};
44 object three = foo(x,y);
45 return;
46 #endif