2 * TCC auto test program
5 /* Unfortunately, gcc version < 3 does not handle that! */
8 /* only gcc 3 handles _Bool correctly */
13 /* test various include syntaxes */
15 #define TCCLIB_INC <tcclib.h>
16 #define TCCLIB_INC1 <tcclib
17 #define TCCLIB_INC2 h>
18 #define TCCLIB_INC3 "tcclib"
22 #include TCCLIB_INC1.TCCLIB_INC2
24 #include TCCLIB_INC1.h>
26 #include TCCLIB_INC3 ".h"
48 void constant_expr_test();
50 void char_short_test();
52 void compound_literal_test(void);
54 void struct_assign_test(void);
56 void bitfield_test(void);
57 void c99_bool_test(void);
58 void float_test(void);
59 void longlong_test(void);
60 void stdarg_test(void);
61 void whitespace_test(void);
62 void relocation_test(void);
63 void old_style_function(void);
64 void sizeof_test(void);
65 void typeof_test(void);
69 void forward_ref(void);
75 #define M1(a, b) (a) + (b)
78 #define glue(a, b) a ## b
79 #define xglue(a, b) glue(a, b)
80 #define HIGHLOW "hello"
81 #define LOW LOW ", world"
83 #define min(a, b) ((a) < (b) ? (a) : (b))
86 #define dprintf(level,...) printf(__VA_ARGS__)
89 /* gcc vararg macros */
90 #define dprintf1(level, fmt, args...) printf(fmt, ## args)
92 #define MACRO_NOARGS()
108 #define __INT64_C(c) c ## LL
109 #define INT64_MIN (-__INT64_C(9223372036854775807)-1)
111 void macro_test(void)
113 printf("macro:\n");\f\v
115 printf("aaa=%d\n", AAA
);
117 printf("min=%d\n", min(1, min(2, -1)));
119 printf("s1=%s\n", glue(HIGH
, LOW
));
120 printf("s2=%s\n", xglue(HIGH
, LOW
));
121 printf("s3=%s\n", str("c"));
122 printf("s4=%s\n", str(a1
));
123 printf("B3=%d\n", B3
);
126 printf("A defined\n");
129 printf("B defined\n");
132 printf("A defined\n");
134 printf("A not defined\n");
137 printf("B defined\n");
139 printf("B not defined\n");
143 printf("A defined\n");
145 printf("B1 defined\n");
147 printf("B1 not defined\n");
150 printf("A not defined\n");
152 printf("B2 defined\n");
154 printf("B2 not defined\n");
159 printf("test true1\n");
162 printf("test true2\n");
165 printf("test true3\n");
168 printf("test trueA\n");
171 printf("test trueB\n");
187 printf("__LINE__ defined\n");
190 printf("__LINE__=%d __FILE__=%s\n",
193 printf("__LINE__=%d __FILE__=%s\n",
196 printf("__LINE__=%d __FILE__=%s\n",
198 #line 198 "tcctest.c"
200 /* not strictly preprocessor, but we test it there */
202 printf("__func__ = %s\n", __func__
);
203 dprintf(1, "vaarg=%d\n", 1);
205 dprintf1(1, "vaarg1\n");
206 dprintf1(1, "vaarg1=%d\n", 2);
207 dprintf1(1, "vaarg1=%d %d\n", 1, 2);
210 printf("func='%s'\n", __FUNCTION__
);
212 /* complicated macros in glibc */
213 printf("INT64_MIN=%Ld\n", INT64_MIN
);
254 printf("\141\1423\143\n");/* dezdez test */
255 printf("\x41\x42\x43\x3a\n");
256 printf("c=%c\n", 'r');
257 printf("wc=%C 0x%lx %C\n", L
'a', L
'\x1234', L
'c');
258 printf("wstring=%S\n", L
"abc");
259 printf("wstring=%S\n", L
"abc" L
"def" "ghi");
260 printf("'\\377'=%d '\\xff'=%d\n", '\377', '\xff');
261 printf("L'\\377'=%d L'\\xff'=%d\n", L
'\377', L
'\xff');
264 while ((b
= b
+ 1) < 96) {
268 printf("fib=%d\n", fib(33));
270 while (b
!= 0x80000000) {
283 for(i
= 0; i
< 10;i
++)
292 /* break/continue tests */
304 /* break/continue tests */
316 for(i
= 0;i
< 10;i
++) {
328 static void *label_table
[3] = { &&label1
, &&label2
, &&label3
};
341 /* we also test computed gotos (GCC extension) */
343 goto *label_table
[i
];
371 printf("enum:\n%d %d %d %d %d %d\n",
372 E0
, E1
, E2
, E3
, E4
, E5
);
374 printf("b1=%d\n", b1
);
385 printf("typedef:\n");
386 printf("a=%d\n", *a
);
391 printf("forward:\n");
397 void forward_ref(void)
399 printf("forward ok\n");
402 typedef struct struct1
{
422 struct struct1 st1
, st2
;
424 int main(int argc
, char **argv
)
442 constant_expr_test();
446 compound_literal_test();
448 struct_assign_test();
457 old_style_function();
470 printf("g1=%d\n", g
);
478 printf("g2=%d\n", g
);
482 printf("g3=%d\n", g
);
486 printf("g4=%d\n", g
);
489 printf("g5=%d\n", g
);
492 void array_test(int a
[4])
497 printf("sizeof(a) = %d\n", sizeof(a
));
498 printf("sizeof(\"a\") = %d\n", sizeof("a"));
500 printf("sizeof(__func__) = %d\n", sizeof(__func__
));
502 printf("sizeof tab %d\n", sizeof(tab
));
503 printf("sizeof tab2 %d\n", sizeof tab2
);
507 printf("%d %d %d\n", tab
[0], tab
[1], tab
[2]);
510 tab2
[i
][j
] = 10 * i
+ j
;
512 printf(" %3d", ((int *)tab2
)[i
]);
521 printf("%d\n", a
+= 1);
522 printf("%d\n", a
-= 2);
523 printf("%d\n", a
*= 31232132);
524 printf("%d\n", a
/= 4);
525 printf("%d\n", a
%= 20);
526 printf("%d\n", a
&= 6);
527 printf("%d\n", a
^= 7);
528 printf("%d\n", a
|= 8);
529 printf("%d\n", a
>>= 3);
530 printf("%d\n", a
<<= 4);
534 printf("%d\n", a
+ 1);
535 printf("%d\n", a
- 2);
536 printf("%d\n", a
* 312);
537 printf("%d\n", a
/ 4);
538 printf("%d\n", b
/ 4);
539 printf("%d\n", (unsigned)b
/ 4);
540 printf("%d\n", a
% 20);
541 printf("%d\n", b
% 20);
542 printf("%d\n", (unsigned)b
% 20);
543 printf("%d\n", a
& 6);
544 printf("%d\n", a
^ 7);
545 printf("%d\n", a
| 8);
546 printf("%d\n", a
>> 3);
547 printf("%d\n", b
>> 3);
548 printf("%d\n", (unsigned)b
>> 3);
549 printf("%d\n", a
<< 4);
554 printf("%d\n", 12 + 1);
555 printf("%d\n", 12 - 2);
556 printf("%d\n", 12 * 312);
557 printf("%d\n", 12 / 4);
558 printf("%d\n", 12 % 20);
559 printf("%d\n", 12 & 6);
560 printf("%d\n", 12 ^ 7);
561 printf("%d\n", 12 | 8);
562 printf("%d\n", 12 >> 2);
563 printf("%d\n", 12 << 4);
567 printf("%d %d %d %d\n",
576 return (c
>= 'a' & c
<= 'z') | (c
>= 'A' & c
<= 'Z') | c
== '_';
579 /**********************/
581 int vstack
[10], *vstack_ptr
;
583 void vpush(int vt
, int vc
)
589 void vpop(int *ft
, int *fc
)
602 vstack_ptr
[-2] &= ~0xffffff80;
604 printf("res= %d %d\n", a
, b
);
607 void constant_expr_test()
610 printf("constant_expr:\n");
612 printf("%d\n", a
* 16);
613 printf("%d\n", a
* 1);
614 printf("%d\n", a
+ 0);
623 printf("expr_ptr:\n");
626 printf("diff=%d\n", q
- p
);
628 printf("inc=%d\n", p
- tab4
);
630 printf("dec=%d\n", p
- tab4
);
632 printf("inc=%d\n", p
- tab4
);
634 printf("dec=%d\n", p
- tab4
);
635 printf("add=%d\n", p
+ 3 - tab4
);
636 printf("add=%d\n", 3 + p
- tab4
);
642 printf("constant_expr:\n");
645 printf("%d\n", a
== a
);
646 printf("%d\n", a
!= a
);
648 printf("%d\n", a
< b
);
649 printf("%d\n", a
<= b
);
650 printf("%d\n", a
<= a
);
651 printf("%d\n", b
>= a
);
652 printf("%d\n", a
>= a
);
653 printf("%d\n", b
> a
);
655 printf("%d\n", (unsigned)a
< b
);
656 printf("%d\n", (unsigned)a
<= b
);
657 printf("%d\n", (unsigned)a
<= a
);
658 printf("%d\n", (unsigned)b
>= a
);
659 printf("%d\n", (unsigned)a
>= a
);
660 printf("%d\n", (unsigned)b
> a
);
669 printf("sizes: %d %d %d %d\n",
670 sizeof(struct struct1
),
671 sizeof(struct struct2
),
672 sizeof(union union1
),
673 sizeof(union union2
));
677 printf("st1: %d %d %d\n",
678 st1
.f1
, st1
.f2
, st1
.f3
);
681 printf("union1: %d\n", st1
.u
.v1
);
684 printf("union2: %d\n", u
.w1
);
689 printf("st2: %d %d %d\n",
690 s
->f1
, s
->f2
, s
->f3
);
691 printf("str_addr=%x\n", (int)st1
.str
- (int)&st1
.f1
);
694 /* XXX: depend on endianness */
695 void char_short_test()
699 printf("char_short:\n");
704 *(char *)&var1
, *(char *)&var2
);
706 *(unsigned char *)&var1
, *(unsigned char *)&var2
);
707 printf("s16=%d %d\n",
708 *(short *)&var1
, *(short *)&var2
);
709 printf("u16=%d %d\n",
710 *(unsigned short *)&var1
, *(unsigned short *)&var2
);
711 printf("s32=%d %d\n",
712 *(int *)&var1
, *(int *)&var2
);
713 printf("u32=%d %d\n",
714 *(unsigned int *)&var1
, *(unsigned int *)&var2
);
715 *(char *)&var1
= 0x08;
716 printf("var1=%x\n", var1
);
717 *(short *)&var1
= 0x0809;
718 printf("var1=%x\n", var1
);
719 *(int *)&var1
= 0x08090a0b;
720 printf("var1=%x\n", var1
);
739 printf("!s=%d\n", !s
);
745 printf("a=%d %d %d\n", 0 || 0, 0 || 1, 1 || 1);
746 printf("a=%d %d %d\n", 0 && 0, 0 && 1, 1 && 1);
747 printf("a=%d %d\n", 1 ? 1 : 0, 0 ? 1 : 0);
762 printf("b=%d\n", a
+ (0 ? 1 : a
/ 2));
764 /* test register spilling */
767 a
= (a
+ b
) * ((a
< b
) ?
768 ((b
- a
) * (a
- b
)): a
+ b
);
771 /* test complex || or && expressions */
775 printf("exp=%d\n", f
== (32 <= a
&& a
<= 3));
776 printf("r=%d\n", (t
|| f
) + (t
&& f
));
781 int aspect_native
= 65536;
782 double bfu_aspect
= 1.0;
784 for(aspect_on
= 0; aspect_on
< 2; aspect_on
++) {
785 aspect
=aspect_on
?(aspect_native
*bfu_aspect
+0.5):65535UL;
786 printf("aspect=%d\n", aspect
);
793 int *cinit2
= (int []){3, 2, 1};
795 void compound_literal_test(void)
800 printf("compound_test:\n");
802 p
= (int []){1, 2, 3};
808 printf("%d", cinit2
[i
]);
812 printf("q1=%s\n", q
);
814 q
= (char *){ "tralala2" };
815 printf("q2=%s\n", q
);
818 printf("q3=%s\n", q3
);
820 q
= (char []){ "tralala3" };
821 printf("q4=%s\n", q
);
824 p
= (int []){1, 2, cinit1
+ 3};
830 p
= (int []){1, 2, 4 + i
};
853 printf("kr_test:\n");
854 printf("func1=%d\n", kr_func1(3, 4));
855 printf("func2=%d\n", kr_func2(3, 4));
862 tab
= (char*)malloc(20);
878 /* structure assignment tests */
884 struct structa1 ssta1
;
886 void struct_assign_test1(struct structa1 s1
, int t
)
888 printf("%d %d %d\n", s1
.f1
, s1
.f2
, t
);
891 struct structa1
struct_assign_test2(struct structa1 s1
, int t
)
898 void struct_assign_test(void)
900 struct structa1 lsta1
, lsta2
;
903 printf("struct_assign_test:\n");
907 printf("%d %d\n", lsta1
.f1
, lsta1
.f2
);
909 printf("%d %d\n", lsta2
.f1
, lsta2
.f2
);
914 struct_assign_test1(lsta2
, 3);
916 printf("before call: %d %d\n", lsta2
.f1
, lsta2
.f2
);
917 lsta2
= struct_assign_test2(lsta2
, 4);
918 printf("after call: %d %d\n", lsta2
.f1
, lsta2
.f2
);
921 /* casts to short/char */
923 void cast1(char a
, short b
, unsigned char c
, unsigned short d
)
925 printf("%d %d %d %d\n", a
, b
, c
, d
);
937 printf("cast_test:\n");
941 printf("%d %d %d %d\n",
944 (unsigned char)(a
+ 1),
945 (unsigned short)(a
+ 1));
946 printf("%d %d %d %d\n",
949 (unsigned char)0xfffff,
950 (unsigned short)0xfffff);
952 a
= (bcast
= 128) + 1;
954 a
= (scast
= 65536) + 1;
957 printf("sizeof(c) = %d, sizeof((int)c) = %d\n", sizeof(c
), sizeof((int)c
));
959 /* test implicit int casting for array accesses */
963 printf("%d %d\n", tab
[0], tab
[1]);
965 /* test implicit casting on some operators */
966 printf("sizeof(+(char)'a') = %d\n", sizeof(+(char)'a'));
967 printf("sizeof(-(char)'a') = %d\n", sizeof(-(char)'a'));
968 printf("sizeof(~(char)'a') = %d\n", sizeof(-(char)'a'));
971 /* initializers tests */
981 int sinit3
[3] = { 1, 2, {{3}}, };
982 int sinit4
[3][2] = { {1, 2}, {3, 4}, {5, 6} };
983 int sinit5
[3][2] = { 1, 2, 3, 4, 5, 6 };
984 int sinit6
[] = { 1, 2, 3 };
985 int sinit7
[] = { [2] = 3, [0] = 1, 2 };
986 char sinit8
[] = "hello" "trala";
988 struct structinit1 sinit9
= { 1, 2, 3 };
989 struct structinit1 sinit10
= { .f2
= 2, 3, .f1
= 1 };
990 struct structinit1 sinit11
= { .f2
= 2, 3, .f1
= 1,
998 char *sinit12
= "hello world";
1004 char sinit14
[10] = { "abc" };
1005 int sinit15
[3] = { sizeof(sinit15
), 1, 2 };
1007 void init_test(void)
1011 int linit4
[3][2] = { {1, 2}, {3, 4}, {5, 6} };
1012 int linit6
[] = { 1, 2, 3 };
1014 char linit8
[] = "hello" "trala";
1015 int linit12
[10] = { 1, 2 };
1016 int linit13
[10] = { 1, 2, [7] = 3, [3] = 4, };
1017 char linit14
[10] = "abc";
1018 int linit15
[10] = { linit1
, linit1
+ 1, [6] = linit1
+ 2, };
1019 struct linit16
{ int a1
, a2
, a3
, a4
; } linit16
= { 1, .a3
= 2 };
1020 int linit17
= sizeof(linit17
);
1022 printf("init_test:\n");
1024 printf("sinit1=%d\n", sinit1
);
1025 printf("sinit2=%d\n", sinit2
);
1026 printf("sinit3=%d %d %d %d\n",
1032 printf("sinit6=%d\n", sizeof(sinit6
));
1033 printf("sinit7=%d %d %d %d\n",
1039 printf("sinit8=%s\n", sinit8
);
1040 printf("sinit9=%d %d %d\n",
1045 printf("sinit10=%d %d %d\n",
1050 printf("sinit11=%d %d %d %d %d %d\n",
1061 printf("[%d][%d] = %d %d %d\n",
1062 i
, j
, sinit4
[i
][j
], sinit5
[i
][j
], linit4
[i
][j
]);
1063 printf("linit1=%d\n", linit1
);
1064 printf("linit2=%d\n", linit2
);
1065 printf("linit6=%d\n", sizeof(linit6
));
1066 printf("linit8=%d %s\n", sizeof(linit8
), linit8
);
1068 printf("sinit12=%s\n", sinit12
);
1069 printf("sinit13=%d %s %s %s\n",
1074 printf("sinit14=%s\n", sinit14
);
1076 for(i
=0;i
<10;i
++) printf(" %d", linit12
[i
]);
1078 for(i
=0;i
<10;i
++) printf(" %d", linit13
[i
]);
1080 for(i
=0;i
<10;i
++) printf(" %d", linit14
[i
]);
1082 for(i
=0;i
<10;i
++) printf(" %d", linit15
[i
]);
1084 printf("%d %d %d %d\n",
1089 /* test that initialisation is done after variable declare */
1090 printf("linit17=%d\n", linit17
);
1091 printf("sinit15=%d\n", sinit15
[0]);
1118 /* ISOC99 _Bool type */
1119 void c99_bool_test(void)
1125 printf("bool_test:\n");
1126 printf("sizeof(_Bool) = %d\n", sizeof(_Bool
));
1128 printf("cast: %d %d %d\n", (_Bool
)10, (_Bool
)0, (_Bool
)a
);
1130 printf("b = %d\n", b
);
1132 printf("b = %d\n", b
);
1136 void bitfield_test(void)
1146 unsigned int f5
: 7;
1148 printf("bitfield_test:");
1149 printf("sizeof(st1) = %d\n", sizeof(st1
));
1158 printf("%d %d %d %d %d\n",
1159 st1
.f1
, st1
.f2
, st1
.f3
, st1
.f4
, st1
.f5
);
1162 #define FTEST(prefix, type, fmt)\
1163 void prefix ## cmp(type a, type b)\
1165 printf("%d %d %d %d %d %d\n",\
1172 printf(fmt " " fmt " " fmt " " fmt " " fmt " " fmt " " fmt "\n",\
1180 printf(fmt "\n", ++a);\
1181 printf(fmt "\n", a++);\
1182 printf(fmt "\n", a);\
1184 void prefix ## fcast(type a)\
1195 printf("ftof: %f %f %Lf\n", fa, da, la);\
1197 ua = (unsigned int)a;\
1198 printf("ftoi: %d %u\n", ia, ua);\
1202 printf("itof: " fmt "\n", b);\
1204 printf("utof: " fmt "\n", b);\
1207 void prefix ## test(void)\
1209 printf("testing '%s'\n", #type);\
1210 prefix ## cmp(1, 2.5);\
1211 prefix ## cmp(2, 1.5);\
1212 prefix ## cmp(1, 1);\
1213 prefix ## fcast(234.6);\
1214 prefix ## fcast(-2334.6);\
1217 FTEST(f
, float, "%f")
1218 FTEST(d
, double, "%f")
1219 FTEST(ld
, long double, "%Lf")
1221 double ftab1
[3] = { 1.2, 3.4, -5.6 };
1224 void float_test(void)
1231 printf("float_test:\n");
1232 printf("sizeof(float) = %d\n", sizeof(float));
1233 printf("sizeof(double) = %d\n", sizeof(double));
1234 printf("sizeof(long double) = %d\n", sizeof(long double));
1238 printf("%f %f %f\n", ftab1
[0], ftab1
[1], ftab1
[2]);
1239 printf("%f %f %f\n", 2.12, .5, 2.3e10
);
1240 // printf("%f %f %f\n", 0x1234p12, 0x1e23.23p10, 0x12dp-10);
1242 printf("da=%f\n", da
);
1244 printf("fa=%f\n", fa
);
1247 printf("da = %f\n", da
);
1250 printf("db = %f\n", db
);
1258 return fib(n
-1) + fib(n
-2);
1270 printf("funcptr:\n");
1277 /* more complicated pointer computation */
1280 printf("sizeof1 = %d\n", sizeof(funcptr_test
));
1281 printf("sizeof2 = %d\n", sizeof funcptr_test
);
1282 printf("sizeof3 = %d\n", sizeof(&funcptr_test
));
1283 printf("sizeof4 = %d\n", sizeof &funcptr_test
);
1286 void lloptest(long long a
, long long b
)
1288 unsigned long long ua
, ub
;
1293 printf("arith: %Ld %Ld %Ld %Ld %Ld\n",
1301 printf("bin: %Ld %Ld %Ld\n",
1307 printf("test: %d %d %d %d %d %d\n",
1315 printf("utest: %d %d %d %d %d %d\n",
1326 printf("arith2: %Ld %Ld\n", a
, b
);
1327 printf("arith2: %Ld %Ld\n", a
++, b
++);
1328 printf("arith2: %Ld %Ld\n", --a
, --b
);
1329 printf("arith2: %Ld %Ld\n", a
, b
);
1332 void llshift(long long a
, int b
)
1334 printf("shift: %Ld %Ld %Ld\n",
1335 (unsigned long long)a
>> b
,
1338 printf("shiftc: %Ld %Ld %Ld\n",
1339 (unsigned long long)a
>> 3,
1342 printf("shiftc: %Ld %Ld %Ld\n",
1343 (unsigned long long)a
>> 35,
1353 long long la
, lb
, lc
;
1354 unsigned long long ula
, ulb
, ulc
;
1357 la
= (la
<< 20) | 0x12345;
1359 printf("la=%Ld ula=%Lu\n", la
, ula
);
1364 printf("lltof: %f %f %Lf\n", fa
, da
, lda
);
1369 printf("ftoll: %Ld %Ld %Ld\n", la
, lb
, lc
);
1374 printf("ulltof: %f %f %Lf\n", fa
, da
, lda
);
1379 printf("ftoull: %Lu %Lu %Lu\n", ula
, ulb
, ulc
);
1382 long long llfunc1(int a
)
1392 long long int value(struct S
*v
)
1394 return ((long long int)v
->item
);
1397 void longlong_test(void)
1402 printf("longlong_test:\n");
1403 printf("sizeof(long long) = %d\n", sizeof(long long));
1408 printf("%Ld %Ld\n", a
, b
);
1409 printf("%Ld %Ld %Ld %Lx\n",
1413 0x1234567812345679);
1418 lloptest(0xff, 0x1234);
1419 b
= 0x72345678 << 10;
1423 b
= 0x72345678LL
<< 10;
1434 /* long long reg spill test */
1439 printf("%lld\n", value(&a
));
1443 void vprintf1(const char *fmt
, ...)
1465 i
= va_arg(ap
, int);
1469 d
= va_arg(ap
, double);
1473 ll
= va_arg(ap
, long long);
1487 void stdarg_test(void)
1489 vprintf1("%d %d %d\n", 1, 2, 3);
1490 vprintf1("%f %d %f\n", 1.0, 2, 3.0);
1491 vprintf1("%l %l %d %f\n", 1234567891234LL, 987654321986LL, 3, 1234.0);
1494 void whitespace_test(void)
1500 ntf("whitspace:\n");\f\v
1509 printf("len1=%d\n", strlen("
1513 printf("len1=%d str[0]=%d\n", strlen(str
), str
[0]);
1514 printf("len1=%d\n", strlen("
a
1518 int reltab
[3] = { 1, 2, 3 };
1520 int *rel1
= &reltab
[1];
1521 int *rel2
= &reltab
[2];
1523 void relocation_test(void)
1525 printf("*rel1=%d\n", *rel1
);
1526 printf("*rel2=%d\n", *rel2
);
1529 void old_style_f(a
,b
,c
)
1533 printf("a=%d b=%d b=%f\n", a
, b
, c
);
1536 void old_style_function(void)
1538 old_style_f((void *)1, 2, 3.0);
1541 void sizeof_test(void)
1546 printf("sizeof(int) = %d\n", sizeof(int));
1547 printf("sizeof(unsigned int) = %d\n", sizeof(unsigned int));
1548 printf("sizeof(short) = %d\n", sizeof(short));
1549 printf("sizeof(unsigned short) = %d\n", sizeof(unsigned short));
1550 printf("sizeof(char) = %d\n", sizeof(char));
1551 printf("sizeof(unsigned char) = %d\n", sizeof(unsigned char));
1552 printf("sizeof(func) = %d\n", sizeof sizeof_test());
1554 printf("sizeof(a++) = %d\n", sizeof a
++);
1555 printf("a=%d\n", a
);
1557 printf("sizeof(**ptr) = %d\n", sizeof (**ptr
));
1559 /* some alignof tests */
1560 printf("__alignof__(int) = %d\n", __alignof__(int));
1561 printf("__alignof__(unsigned int) = %d\n", __alignof__(unsigned int));
1562 printf("__alignof__(short) = %d\n", __alignof__(short));
1563 printf("__alignof__(unsigned short) = %d\n", __alignof__(unsigned short));
1564 printf("__alignof__(char) = %d\n", __alignof__(char));
1565 printf("__alignof__(unsigned char) = %d\n", __alignof__(unsigned char));
1566 printf("__alignof__(func) = %d\n", __alignof__
sizeof_test());
1569 void typeof_test(void)
1578 printf("a=%f b=%f c=%f\n", a
, b
, c
);