Mercurial > hg > CbC > old > device
annotate test/scope.c @ 503:3c95c69aa80e
*** empty log message ***
author | kono |
---|---|
date | Fri, 23 Dec 2005 19:44:26 +0900 |
parents | a379da780856 |
children | dbfd6e88e2c3 |
rev | line source |
---|---|
363 | 1 /* |
2 | |
3 gcc -g -std=gnu99 test/scope.c | |
4 | |
5 */ | |
6 | |
7 #include <stdio.h> | |
8 | |
9 void | |
10 f(int *i,void *label) | |
11 { | |
12 static int k = 3; | |
13 { | |
14 static int k = 3; | |
15 *i = k++; | |
16 } | |
17 k--; | |
427 | 18 printf("#0017:f %d\n",k); |
363 | 19 } |
20 | |
21 int | |
22 main() | |
23 { | |
24 int i,k; | |
25 void *exit = &&exit0; | |
26 i = 3;k=10; | |
27 for(int k=0;k<10;k++) { | |
28 int i; | |
29 i = 4; | |
30 if (({ | |
31 __label__ exit0; | |
32 int i; | |
33 f(&i,&&exit0); | |
34 if (i==5) | |
35 goto exit0; | |
427 | 36 printf("#0035:2nd inner %d %d %0x\n",i,k,&&exit1==exit); |
363 | 37 exit0: |
38 i; | |
39 })!=7) { | |
40 goto exit1; | |
41 } else | |
42 goto *exit; | |
450
eaf9e2746c83
parallel assign for simple expr. (too complex solution)
kono
parents:
427
diff
changeset
|
43 /* not reached */ |
eaf9e2746c83
parallel assign for simple expr. (too complex solution)
kono
parents:
427
diff
changeset
|
44 i = ({ int k=3; k; }); |
363 | 45 exit1: |
491 | 46 printf("#0045:inner %d %d %0x\n",i,k,&&exit1==exit); |
363 | 47 } |
48 k++; | |
49 exit0: | |
491 | 50 printf("#0049:outer %d %d %0x\n",i,k,&&exit0==exit); |
363 | 51 return 0; |
52 } |