annotate test/scope.c @ 424:485bf7dde96a non-aligned-bit-field

ARM non-aligned bitfield
author kono
date Fri, 29 Oct 2004 20:34:08 +0900
parents f3f2b7906d50
children 0c256ea2a97e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
363
f3f2b7906d50 label extension
kono
parents:
diff changeset
1 /*
f3f2b7906d50 label extension
kono
parents:
diff changeset
2
f3f2b7906d50 label extension
kono
parents:
diff changeset
3 gcc -g -std=gnu99 test/scope.c
f3f2b7906d50 label extension
kono
parents:
diff changeset
4
f3f2b7906d50 label extension
kono
parents:
diff changeset
5 */
f3f2b7906d50 label extension
kono
parents:
diff changeset
6
f3f2b7906d50 label extension
kono
parents:
diff changeset
7 #include <stdio.h>
f3f2b7906d50 label extension
kono
parents:
diff changeset
8
f3f2b7906d50 label extension
kono
parents:
diff changeset
9 void
f3f2b7906d50 label extension
kono
parents:
diff changeset
10 f(int *i,void *label)
f3f2b7906d50 label extension
kono
parents:
diff changeset
11 {
f3f2b7906d50 label extension
kono
parents:
diff changeset
12 static int k = 3;
f3f2b7906d50 label extension
kono
parents:
diff changeset
13 {
f3f2b7906d50 label extension
kono
parents:
diff changeset
14 static int k = 3;
f3f2b7906d50 label extension
kono
parents:
diff changeset
15 *i = k++;
f3f2b7906d50 label extension
kono
parents:
diff changeset
16 }
f3f2b7906d50 label extension
kono
parents:
diff changeset
17 k--;
f3f2b7906d50 label extension
kono
parents:
diff changeset
18 printf("f %d\n",k);
f3f2b7906d50 label extension
kono
parents:
diff changeset
19 }
f3f2b7906d50 label extension
kono
parents:
diff changeset
20
f3f2b7906d50 label extension
kono
parents:
diff changeset
21 int
f3f2b7906d50 label extension
kono
parents:
diff changeset
22 main()
f3f2b7906d50 label extension
kono
parents:
diff changeset
23 {
f3f2b7906d50 label extension
kono
parents:
diff changeset
24 int i,k;
f3f2b7906d50 label extension
kono
parents:
diff changeset
25 void *exit = &&exit0;
f3f2b7906d50 label extension
kono
parents:
diff changeset
26 i = 3;k=10;
f3f2b7906d50 label extension
kono
parents:
diff changeset
27 for(int k=0;k<10;k++) {
f3f2b7906d50 label extension
kono
parents:
diff changeset
28 int i;
f3f2b7906d50 label extension
kono
parents:
diff changeset
29 i = 4;
f3f2b7906d50 label extension
kono
parents:
diff changeset
30 if (({
f3f2b7906d50 label extension
kono
parents:
diff changeset
31 __label__ exit0;
f3f2b7906d50 label extension
kono
parents:
diff changeset
32 int i;
f3f2b7906d50 label extension
kono
parents:
diff changeset
33 f(&i,&&exit0);
f3f2b7906d50 label extension
kono
parents:
diff changeset
34 if (i==5)
f3f2b7906d50 label extension
kono
parents:
diff changeset
35 goto exit0;
f3f2b7906d50 label extension
kono
parents:
diff changeset
36 printf("2nd inner %d %d %0x\n",i,k,&&exit1==exit);
f3f2b7906d50 label extension
kono
parents:
diff changeset
37 exit0:
f3f2b7906d50 label extension
kono
parents:
diff changeset
38 i;
f3f2b7906d50 label extension
kono
parents:
diff changeset
39 })!=7) {
f3f2b7906d50 label extension
kono
parents:
diff changeset
40 goto exit1;
f3f2b7906d50 label extension
kono
parents:
diff changeset
41 } else
f3f2b7906d50 label extension
kono
parents:
diff changeset
42 goto *exit;
f3f2b7906d50 label extension
kono
parents:
diff changeset
43 exit1:
f3f2b7906d50 label extension
kono
parents:
diff changeset
44 printf("inner %d %d %0x\n",i,k,&&exit1==exit);
f3f2b7906d50 label extension
kono
parents:
diff changeset
45 }
f3f2b7906d50 label extension
kono
parents:
diff changeset
46 k++;
f3f2b7906d50 label extension
kono
parents:
diff changeset
47 exit0:
f3f2b7906d50 label extension
kono
parents:
diff changeset
48 printf("outer %d %d %0x\n",i,k,&&exit0==exit);
f3f2b7906d50 label extension
kono
parents:
diff changeset
49 return 0;
f3f2b7906d50 label extension
kono
parents:
diff changeset
50 }