tcc -MD: drop system includes and duplicates
[tinycc.git] / tests / tests2 / 89_nocode_wanted.c
blob73e0a4bc872028d3c14643ce0d4f9a7ce43cce2a
1 extern int printf(const char *format, ...);
2 static void kb_wait_1(void)
4 unsigned long timeout = 2;
5 do {
6 (1 ?
7 printf("timeout=%ld\n", timeout) :
8 ({
9 while (1)
10 printf("error\n");
13 timeout--;
14 } while (timeout);
16 static void kb_wait_2(void)
18 unsigned long timeout = 2;
19 do {
20 (1 ?
21 printf("timeout=%ld\n", timeout) :
23 for (;;)
24 printf("error\n");
27 timeout--;
28 } while (timeout);
30 static void kb_wait_2_1(void)
32 unsigned long timeout = 2;
33 do {
34 (1 ?
35 printf("timeout=%ld\n", timeout) :
37 do {
38 printf("error\n");
39 } while (1);
42 timeout--;
43 } while (timeout);
45 static void kb_wait_2_2(void)
47 unsigned long timeout = 2;
48 do {
49 (1 ?
50 printf("timeout=%ld\n", timeout) :
52 label:
53 printf("error\n");
54 goto label;
57 timeout--;
58 } while (timeout);
60 static void kb_wait_3(void)
62 unsigned long timeout = 2;
63 do {
64 (1 ?
65 printf("timeout=%ld\n", timeout) :
67 int i = 1;
68 goto label;
69 i = i + 2;
70 label:
71 i = i + 3;
74 timeout--;
75 } while (timeout);
77 static void kb_wait_4(void)
79 unsigned long timeout = 2;
80 do {
81 (1 ?
82 printf("timeout=%ld\n", timeout) :
84 switch(timeout) {
85 case 2:
86 printf("timeout is 2");
87 break;
88 case 1:
89 printf("timeout is 1");
90 break;
91 default:
92 printf("timeout is 0?");
93 break;
95 // return;
98 timeout--;
99 } while (timeout);
101 int main()
103 printf("begin\n");
104 kb_wait_1();
105 kb_wait_2();
106 kb_wait_2_1();
107 kb_wait_2_2();
108 kb_wait_3();
109 kb_wait_4();
110 printf("end\n");
111 return 0;