elf: Support STB_LOCAL dynamic symbols
[tinycc.git] / tests / tests2 / 79_vla_continue.c
blob91215c99e113355d6f70ae871a4fee0c5dc06a12
1 #include <stdio.h>
3 int f(void)
5 return 5;
8 void test1()
10 int count = 10;
11 void *addr[10];
12 for(;count--;) {
13 int a[f()];
15 addr[count] = a;
17 continue;
20 if(addr[9] == addr[0]) {
21 printf("OK\n");
22 } else {
23 printf("NOT OK\n");
27 void test2()
29 int count = 10;
30 void *addr[count];
31 for(;count--;) {
32 int a[f()];
34 addr[count] = a;
36 continue;
39 if(addr[9] == addr[0]) {
40 printf("OK\n");
41 } else {
42 printf("NOT OK\n");
46 void test3()
48 int count = 10;
49 void *addr[count];
50 while(count--) {
51 int a[f()];
53 addr[count] = a;
55 continue;
58 if(addr[9] == addr[0]) {
59 printf("OK\n");
60 } else {
61 printf("NOT OK\n");
65 void test4()
67 int count = 10;
68 void *addr[count];
69 do {
70 int a[f()];
72 addr[--count] = a;
74 continue;
75 } while (count);
77 if(addr[9] == addr[0]) {
78 printf("OK\n");
79 } else {
80 printf("NOT OK\n");
84 void test5()
86 int count = 10;
87 int a[f()];
88 int c[f()];
90 c[0] = 42;
92 for(;count--;) {
93 int b[f()];
94 int i;
95 for (i=0; i<f(); i++) {
96 b[i] = count;
100 if (c[0] == 42) {
101 printf("OK\n");
102 } else {
103 printf("NOT OK\n");
107 int main(void)
109 test1();
110 test2();
111 test3();
112 test4();
113 test5();
115 return 0;