source: EcnlProtoTool/trunk/tcc-0.9.27/tests/tests2/79_vla_continue.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: 1.3 KB
Line 
1#include <stdio.h>
2
3int f(void)
4{
5 return 5;
6}
7
8void test1()
9{
10 int count = 10;
11 void *addr[10];
12 for(;count--;) {
13 int a[f()];
14
15 addr[count] = a;
16
17 continue;
18 }
19
20 if(addr[9] == addr[0]) {
21 printf("OK\n");
22 } else {
23 printf("NOT OK\n");
24 }
25}
26
27void test2()
28{
29 int count = 10;
30 void *addr[count];
31 for(;count--;) {
32 int a[f()];
33
34 addr[count] = a;
35
36 continue;
37 }
38
39 if(addr[9] == addr[0]) {
40 printf("OK\n");
41 } else {
42 printf("NOT OK\n");
43 }
44}
45
46void test3()
47{
48 int count = 10;
49 void *addr[count];
50 while(count--) {
51 int a[f()];
52
53 addr[count] = a;
54
55 continue;
56 }
57
58 if(addr[9] == addr[0]) {
59 printf("OK\n");
60 } else {
61 printf("NOT OK\n");
62 }
63}
64
65void test4()
66{
67 int count = 10;
68 void *addr[count];
69 do {
70 int a[f()];
71
72 addr[--count] = a;
73
74 continue;
75 } while (count);
76
77 if(addr[9] == addr[0]) {
78 printf("OK\n");
79 } else {
80 printf("NOT OK\n");
81 }
82}
83
84void test5()
85{
86 int count = 10;
87 int a[f()];
88 int c[f()];
89
90 c[0] = 42;
91
92 for(;count--;) {
93 int b[f()];
94 int i;
95 for (i=0; i<f(); i++) {
96 b[i] = count;
97 }
98 }
99
100 if (c[0] == 42) {
101 printf("OK\n");
102 } else {
103 printf("NOT OK\n");
104 }
105}
106
107int main(void)
108{
109 test1();
110 test2();
111 test3();
112 test4();
113 test5();
114
115 return 0;
116}
Note: See TracBrowser for help on using the repository browser.