source: EcnlProtoTool/trunk/tcc-0.9.27/tests/tests2/89_nocode_wanted.c@ 331

Last change on this file since 331 was 331, checked in by coas-nagasima, 6 years ago

prototoolに関連するプロジェクトをnewlibからmuslを使うよう変更・更新
ntshellをnewlibの下位の実装から、muslのsyscallの実装に変更・更新
以下のOSSをアップデート
・mruby-1.3.0
・musl-1.1.18
・onigmo-6.1.3
・tcc-0.9.27
以下のOSSを追加
・openssl-1.1.0e
・curl-7.57.0
・zlib-1.2.11
以下のmrbgemsを追加
・iij/mruby-digest
・iij/mruby-env
・iij/mruby-errno
・iij/mruby-iijson
・iij/mruby-ipaddr
・iij/mruby-mock
・iij/mruby-require
・iij/mruby-tls-openssl

  • Property svn:eol-style set to native
  • Property svn:mime-type set to text/x-csrc
File size: 2.3 KB
Line 
1extern int printf(const char *format, ...);
2static void kb_wait_1(void)
3{
4 unsigned long timeout = 2;
5 do {
6 (1 ?
7 printf("timeout=%ld\n", timeout) :
8 ({
9 while (1)
10 printf("error\n");
11 })
12 );
13 timeout--;
14 } while (timeout);
15}
16static void kb_wait_2(void)
17{
18 unsigned long timeout = 2;
19 do {
20 (1 ?
21 printf("timeout=%ld\n", timeout) :
22 ({
23 for (;;)
24 printf("error\n");
25 })
26 );
27 timeout--;
28 } while (timeout);
29}
30static void kb_wait_2_1(void)
31{
32 unsigned long timeout = 2;
33 do {
34 (1 ?
35 printf("timeout=%ld\n", timeout) :
36 ({
37 do {
38 printf("error\n");
39 } while (1);
40 })
41 );
42 timeout--;
43 } while (timeout);
44}
45static void kb_wait_2_2(void)
46{
47 unsigned long timeout = 2;
48 do {
49 (1 ?
50 printf("timeout=%ld\n", timeout) :
51 ({
52 label:
53 printf("error\n");
54 goto label;
55 })
56 );
57 timeout--;
58 } while (timeout);
59}
60static void kb_wait_3(void)
61{
62 unsigned long timeout = 2;
63 do {
64 (1 ?
65 printf("timeout=%ld\n", timeout) :
66 ({
67 int i = 1;
68 goto label;
69 i = i + 2;
70 label:
71 i = i + 3;
72 })
73 );
74 timeout--;
75 } while (timeout);
76}
77static void kb_wait_4(void)
78{
79 unsigned long timeout = 2;
80 do {
81 (1 ?
82 printf("timeout=%ld\n", timeout) :
83 ({
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;
94 };
95 // return;
96 })
97 );
98 timeout--;
99 } while (timeout);
100}
101int main()
102{
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;
112}
Note: See TracBrowser for help on using the repository browser.