1 /*****************************************************************************/
2 /* test 'nodata_wanted' data output suppression */
4 #if defined test_static_data_error
7 static short w
= (int)&foo
; /* initializer not computable */
11 #elif defined test_static_nodata_error
14 static short w
= (int)&foo
; /* initializer not computable */
18 #elif defined test_global_data_error
20 static short w
= (int)&foo
; /* initializer not computable */
23 #elif defined test_local_data_noerror
25 short w
= &foo
; /* 2 cast warnings */
28 #elif defined test_data_suppression_off || defined test_data_suppression_on
30 #if defined test_data_suppression_on
37 /* some gcc headers #define __attribute__ to empty if it's not gcc */
42 __label__ ts0
, te0
, ts1
, te1
;
45 static const char ds0
= 0;
46 static const char de0
= 0;
47 /* get reference size of empty jmp */
52 tl
= -(&&te0
- &&ts0
);
54 /* test data and code suppression */
55 static const char ds1
= 0;
58 void *p
= (void*)&main
;
59 char cc
[] = "static string";
63 __attribute__((packed
))
68 unsigned z
: 28, a
: 4, b
: 5;
69 } s
= { 0x333,0x44,0x555555,6,7 };
72 printf(" %d - %.1f - %.1f - %s - %s\n",
73 sizeof 8.0, 8.0, d
, __FUNCTION__
, cc
);
74 printf(" %x %x %x %x %x\n",
75 s
.x
, s
.y
, s
.z
, s
.a
, s
.b
);
78 static const char de1
= 0;
82 printf("size of data/text:\n %s/%s\n",
83 dl
? "non-zero":"zero", tl
? "non-zero":"zero");
84 /*printf("# %d/%d\n", dl, tl);*/
87 #elif defined test_static_data
90 int main(int argc
, char **argv
)
95 printf("hello\n"); /* the "hello\n" string is still suppressed */
97 printf("a = %d\n", a
);