struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / gcc-torture-execute-950426-1.c
blobe3f69e855beed767e63a4074f1080c424fbd976a
1 /*
2 950426-1.c from the execute part of the gcc torture suite.
3 */
5 #include <testfwk.h>
7 #ifdef __SDCC
8 #pragma std_c99
9 #pragma disable_warning 85
10 #pragma disable_warning 196
11 #endif
13 #include <string.h>
15 struct tag {
16 int m1;
17 char *m2[5];
18 } s1, *p1;
20 int i;
22 int func1(int *p);
24 void foo (char *s);
26 void
27 testTortureExecute (void)
29 s1.m1 = -1;
30 p1 = &s1;
32 if ( func1( &p1->m1 ) == -1 )
33 foo ("ok");
34 else
35 ASSERT (0);
37 i = 3;
38 s1.m2[3]= "123";
40 if ( strlen( (p1->m2[i])++ ) == 3 )
41 foo ("ok");
42 else
43 ASSERT (0);
45 return;
48 int func1(int *p) { return(*p); }
50 void foo (char *s) {}