annotate test/strinit.c @ 794:032dc03be02e

i64 arg_register in inline mode
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Tue, 23 Nov 2010 09:42:08 +0900
parents b674d8421430
children c55337499f96
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
467
32737bad7489 fix list/tag interference
kono
parents: 448
diff changeset
1 #include <stdio.h>
448
422415e15eb8 *** empty log message ***
kono
parents:
diff changeset
2
656
8320ae3ac186 inlined strinit
kono
parents: 655
diff changeset
3 #ifndef INLINE
8320ae3ac186 inlined strinit
kono
parents: 655
diff changeset
4 #define INLINE
8320ae3ac186 inlined strinit
kono
parents: 655
diff changeset
5 #endif
8320ae3ac186 inlined strinit
kono
parents: 655
diff changeset
6
8320ae3ac186 inlined strinit
kono
parents: 655
diff changeset
7 INLINE void main7();
8320ae3ac186 inlined strinit
kono
parents: 655
diff changeset
8 INLINE int main8();
608
c3ba27861c83 fix struct alignment in local init.
kono
parents: 573
diff changeset
9
448
422415e15eb8 *** empty log message ***
kono
parents:
diff changeset
10 int b[3] = {1,2,3};
422415e15eb8 *** empty log message ***
kono
parents:
diff changeset
11
422415e15eb8 *** empty log message ***
kono
parents:
diff changeset
12 struct temp {
770
b674d8421430 i64 inline ( indirect call )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 748
diff changeset
13 long a;
b674d8421430 i64 inline ( indirect call )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 748
diff changeset
14 long b;
b674d8421430 i64 inline ( indirect call )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 748
diff changeset
15 long c;
b674d8421430 i64 inline ( indirect call )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 748
diff changeset
16 long d;
542
492f06738550 working... (struct init fix)
kono
parents: 491
diff changeset
17 struct hoge {
770
b674d8421430 i64 inline ( indirect call )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 748
diff changeset
18 long k;
b674d8421430 i64 inline ( indirect call )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 748
diff changeset
19 long j;
542
492f06738550 working... (struct init fix)
kono
parents: 491
diff changeset
20 } m;
770
b674d8421430 i64 inline ( indirect call )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 748
diff changeset
21 long e;
448
422415e15eb8 *** empty log message ***
kono
parents:
diff changeset
22 } temp1 = {
422415e15eb8 *** empty log message ***
kono
parents:
diff changeset
23 // 101,
422415e15eb8 *** empty log message ***
kono
parents:
diff changeset
24 // 102,
422415e15eb8 *** empty log message ***
kono
parents:
diff changeset
25 // 103,
422415e15eb8 *** empty log message ***
kono
parents:
diff changeset
26 // 104,
422415e15eb8 *** empty log message ***
kono
parents:
diff changeset
27 // 105,
422415e15eb8 *** empty log message ***
kono
parents:
diff changeset
28 .e = 5,
422415e15eb8 *** empty log message ***
kono
parents:
diff changeset
29 .a = 3
422415e15eb8 *** empty log message ***
kono
parents:
diff changeset
30 };
422415e15eb8 *** empty log message ***
kono
parents:
diff changeset
31
422415e15eb8 *** empty log message ***
kono
parents:
diff changeset
32 struct temp temp3 = {
770
b674d8421430 i64 inline ( indirect call )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 748
diff changeset
33 .c = (long)&b,
448
422415e15eb8 *** empty log message ***
kono
parents:
diff changeset
34 .d = -10,
770
b674d8421430 i64 inline ( indirect call )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 748
diff changeset
35 .a = (long)b
448
422415e15eb8 *** empty log message ***
kono
parents:
diff changeset
36 };
422415e15eb8 *** empty log message ***
kono
parents:
diff changeset
37
542
492f06738550 working... (struct init fix)
kono
parents: 491
diff changeset
38 struct temp temp4 = { 1,2,3,4,5,6,7};
492f06738550 working... (struct init fix)
kono
parents: 491
diff changeset
39 struct temp temp7 = { 1,2,3,4,{5,6},7};
448
422415e15eb8 *** empty log message ***
kono
parents:
diff changeset
40
553
293f827ccfb2 Linux kernel source compiled.
kono
parents: 550
diff changeset
41 #if 0
293f827ccfb2 Linux kernel source compiled.
kono
parents: 550
diff changeset
42 struct temp temp10 = {
293f827ccfb2 Linux kernel source compiled.
kono
parents: 550
diff changeset
43 .m = (struct hoge){}, // not allowed in global
293f827ccfb2 Linux kernel source compiled.
kono
parents: 550
diff changeset
44 .c = (int)&b,
293f827ccfb2 Linux kernel source compiled.
kono
parents: 550
diff changeset
45 };
293f827ccfb2 Linux kernel source compiled.
kono
parents: 550
diff changeset
46 #endif
293f827ccfb2 Linux kernel source compiled.
kono
parents: 550
diff changeset
47
656
8320ae3ac186 inlined strinit
kono
parents: 655
diff changeset
48 INLINE void
547
9defd9459016 *** empty log message ***
kono
parents: 542
diff changeset
49 linux_kernel();
448
422415e15eb8 *** empty log message ***
kono
parents:
diff changeset
50
559
c55b51d51f8f *** empty log message ***
kono
parents: 553
diff changeset
51 struct test{
c55b51d51f8f *** empty log message ***
kono
parents: 553
diff changeset
52 int a,b,c;
c55b51d51f8f *** empty log message ***
kono
parents: 553
diff changeset
53 } huga = {
c55b51d51f8f *** empty log message ***
kono
parents: 553
diff changeset
54 0,0,0,
c55b51d51f8f *** empty log message ***
kono
parents: 553
diff changeset
55 };
c55b51d51f8f *** empty log message ***
kono
parents: 553
diff changeset
56
547
9defd9459016 *** empty log message ***
kono
parents: 542
diff changeset
57 typedef unsigned int __u32;
9defd9459016 *** empty log message ***
kono
parents: 542
diff changeset
58 typedef unsigned short __u16;
9defd9459016 *** empty log message ***
kono
parents: 542
diff changeset
59 typedef unsigned char __u8;
9defd9459016 *** empty log message ***
kono
parents: 542
diff changeset
60 typedef unsigned int u32;
9defd9459016 *** empty log message ***
kono
parents: 542
diff changeset
61 typedef unsigned short u16;
9defd9459016 *** empty log message ***
kono
parents: 542
diff changeset
62 typedef unsigned char u8;
9defd9459016 *** empty log message ***
kono
parents: 542
diff changeset
63 struct in6_addr { char hoge[128]; };
9defd9459016 *** empty log message ***
kono
parents: 542
diff changeset
64
9defd9459016 *** empty log message ***
kono
parents: 542
diff changeset
65 struct flowi {
9defd9459016 *** empty log message ***
kono
parents: 542
diff changeset
66 int oif;
9defd9459016 *** empty log message ***
kono
parents: 542
diff changeset
67 int iif;
9defd9459016 *** empty log message ***
kono
parents: 542
diff changeset
68
9defd9459016 *** empty log message ***
kono
parents: 542
diff changeset
69 union {
9defd9459016 *** empty log message ***
kono
parents: 542
diff changeset
70 struct {
9defd9459016 *** empty log message ***
kono
parents: 542
diff changeset
71 __u32 daddr;
9defd9459016 *** empty log message ***
kono
parents: 542
diff changeset
72 __u32 saddr;
9defd9459016 *** empty log message ***
kono
parents: 542
diff changeset
73 __u32 fwmark;
9defd9459016 *** empty log message ***
kono
parents: 542
diff changeset
74 __u8 tos;
9defd9459016 *** empty log message ***
kono
parents: 542
diff changeset
75 __u8 scope;
9defd9459016 *** empty log message ***
kono
parents: 542
diff changeset
76 } ip4_u;
9defd9459016 *** empty log message ***
kono
parents: 542
diff changeset
77
9defd9459016 *** empty log message ***
kono
parents: 542
diff changeset
78 struct {
9defd9459016 *** empty log message ***
kono
parents: 542
diff changeset
79 struct in6_addr daddr;
9defd9459016 *** empty log message ***
kono
parents: 542
diff changeset
80 struct in6_addr saddr;
9defd9459016 *** empty log message ***
kono
parents: 542
diff changeset
81 __u32 flowlabel;
9defd9459016 *** empty log message ***
kono
parents: 542
diff changeset
82 } ip6_u;
9defd9459016 *** empty log message ***
kono
parents: 542
diff changeset
83
9defd9459016 *** empty log message ***
kono
parents: 542
diff changeset
84 struct {
9defd9459016 *** empty log message ***
kono
parents: 542
diff changeset
85 __u16 daddr;
9defd9459016 *** empty log message ***
kono
parents: 542
diff changeset
86 __u16 saddr;
9defd9459016 *** empty log message ***
kono
parents: 542
diff changeset
87 __u32 fwmark;
9defd9459016 *** empty log message ***
kono
parents: 542
diff changeset
88 __u8 scope;
9defd9459016 *** empty log message ***
kono
parents: 542
diff changeset
89 } dn_u;
9defd9459016 *** empty log message ***
kono
parents: 542
diff changeset
90 } nl_u;
9defd9459016 *** empty log message ***
kono
parents: 542
diff changeset
91 __u8 proto;
9defd9459016 *** empty log message ***
kono
parents: 542
diff changeset
92 __u8 flags;
9defd9459016 *** empty log message ***
kono
parents: 542
diff changeset
93 union {
9defd9459016 *** empty log message ***
kono
parents: 542
diff changeset
94 struct {
9defd9459016 *** empty log message ***
kono
parents: 542
diff changeset
95 __u16 sport;
9defd9459016 *** empty log message ***
kono
parents: 542
diff changeset
96 __u16 dport;
9defd9459016 *** empty log message ***
kono
parents: 542
diff changeset
97 } ports;
9defd9459016 *** empty log message ***
kono
parents: 542
diff changeset
98
9defd9459016 *** empty log message ***
kono
parents: 542
diff changeset
99 struct {
9defd9459016 *** empty log message ***
kono
parents: 542
diff changeset
100 __u8 type;
9defd9459016 *** empty log message ***
kono
parents: 542
diff changeset
101 __u8 code__;
9defd9459016 *** empty log message ***
kono
parents: 542
diff changeset
102 } icmpt;
9defd9459016 *** empty log message ***
kono
parents: 542
diff changeset
103
9defd9459016 *** empty log message ***
kono
parents: 542
diff changeset
104 struct {
9defd9459016 *** empty log message ***
kono
parents: 542
diff changeset
105 __u16 sport;
9defd9459016 *** empty log message ***
kono
parents: 542
diff changeset
106 __u16 dport;
9defd9459016 *** empty log message ***
kono
parents: 542
diff changeset
107
9defd9459016 *** empty log message ***
kono
parents: 542
diff changeset
108 __u8 objnum;
9defd9459016 *** empty log message ***
kono
parents: 542
diff changeset
109 __u8 objnamel;
9defd9459016 *** empty log message ***
kono
parents: 542
diff changeset
110 __u8 objname[16];
9defd9459016 *** empty log message ***
kono
parents: 542
diff changeset
111 } dnports;
9defd9459016 *** empty log message ***
kono
parents: 542
diff changeset
112
9defd9459016 *** empty log message ***
kono
parents: 542
diff changeset
113 __u32 spi;
9defd9459016 *** empty log message ***
kono
parents: 542
diff changeset
114 } uli_u;
9defd9459016 *** empty log message ***
kono
parents: 542
diff changeset
115 } __attribute__((__aligned__(32/8)));
9defd9459016 *** empty log message ***
kono
parents: 542
diff changeset
116
9defd9459016 *** empty log message ***
kono
parents: 542
diff changeset
117
682
639db8597a58 decl_data optimization
kono
parents: 656
diff changeset
118 INLINE static /* __inline__ __attribute__((always_inline)) __attribute__((always_inline)) */
559
c55b51d51f8f *** empty log message ***
kono
parents: 553
diff changeset
119 void ip_route_connect(/* struct rtable **rp, */ u32 dst,
547
9defd9459016 *** empty log message ***
kono
parents: 542
diff changeset
120 u32 src, u32 tos, int oif, u8 protocol,
9defd9459016 *** empty log message ***
kono
parents: 542
diff changeset
121 u16 sport, u16 dport /*, struct sock *sk */)
9defd9459016 *** empty log message ***
kono
parents: 542
diff changeset
122 {
9defd9459016 *** empty log message ***
kono
parents: 542
diff changeset
123 struct flowi fl = { .oif = oif,
9defd9459016 *** empty log message ***
kono
parents: 542
diff changeset
124 .nl_u = { .ip4_u = { .daddr = dst,
9defd9459016 *** empty log message ***
kono
parents: 542
diff changeset
125 .saddr = src,
9defd9459016 *** empty log message ***
kono
parents: 542
diff changeset
126 .tos = tos } },
9defd9459016 *** empty log message ***
kono
parents: 542
diff changeset
127 .proto = protocol,
9defd9459016 *** empty log message ***
kono
parents: 542
diff changeset
128 .uli_u = { .ports =
9defd9459016 *** empty log message ***
kono
parents: 542
diff changeset
129 { .sport = sport,
9defd9459016 *** empty log message ***
kono
parents: 542
diff changeset
130 .dport = dport } } };
9defd9459016 *** empty log message ***
kono
parents: 542
diff changeset
131
682
639db8597a58 decl_data optimization
kono
parents: 656
diff changeset
132 printf("#0131:%x %x\n",fl.oif,fl.uli_u.ports.dport);
547
9defd9459016 *** empty log message ***
kono
parents: 542
diff changeset
133 }
9defd9459016 *** empty log message ***
kono
parents: 542
diff changeset
134
656
8320ae3ac186 inlined strinit
kono
parents: 655
diff changeset
135 INLINE static
559
c55b51d51f8f *** empty log message ***
kono
parents: 553
diff changeset
136 void ip_route_connect0(/* struct rtable **rp, */ u32 dst,
548
650717de878b *** empty log message ***
kono
parents: 547
diff changeset
137 u32 src, u32 tos, int oif, u8 protocol,
650717de878b *** empty log message ***
kono
parents: 547
diff changeset
138 u16 sport, u16 dport /*, struct sock *sk */)
650717de878b *** empty log message ***
kono
parents: 547
diff changeset
139 {
650717de878b *** empty log message ***
kono
parents: 547
diff changeset
140 struct flowi fl = { .oif = oif,
650717de878b *** empty log message ***
kono
parents: 547
diff changeset
141 .iif = 55,
650717de878b *** empty log message ***
kono
parents: 547
diff changeset
142 .nl_u = { .ip4_u = { .daddr = dst,
650717de878b *** empty log message ***
kono
parents: 547
diff changeset
143 .saddr = 66,
650717de878b *** empty log message ***
kono
parents: 547
diff changeset
144 .tos = tos } },
650717de878b *** empty log message ***
kono
parents: 547
diff changeset
145 .proto = protocol,
650717de878b *** empty log message ***
kono
parents: 547
diff changeset
146 .uli_u = { .ports =
650717de878b *** empty log message ***
kono
parents: 547
diff changeset
147 { .sport = sport,
650717de878b *** empty log message ***
kono
parents: 547
diff changeset
148 .dport = dport } } };
650717de878b *** empty log message ***
kono
parents: 547
diff changeset
149
682
639db8597a58 decl_data optimization
kono
parents: 656
diff changeset
150 printf("#0149:%x %x\n",fl.oif,fl.uli_u.ports.dport);
639db8597a58 decl_data optimization
kono
parents: 656
diff changeset
151 printf("#0150:%x %x\n",fl.iif,fl.nl_u.ip4_u.saddr);
639db8597a58 decl_data optimization
kono
parents: 656
diff changeset
152 }
639db8597a58 decl_data optimization
kono
parents: 656
diff changeset
153
639db8597a58 decl_data optimization
kono
parents: 656
diff changeset
154 INLINE static
639db8597a58 decl_data optimization
kono
parents: 656
diff changeset
155 void ip_route_connect1(/* struct rtable **rp, */ u32 dst,
639db8597a58 decl_data optimization
kono
parents: 656
diff changeset
156 u32 src, u32 tos, int oif, u8 protocol,
639db8597a58 decl_data optimization
kono
parents: 656
diff changeset
157 u16 sport, u16 dport /*, struct sock *sk */)
639db8597a58 decl_data optimization
kono
parents: 656
diff changeset
158 {
639db8597a58 decl_data optimization
kono
parents: 656
diff changeset
159 struct flowi fl, *flp;
639db8597a58 decl_data optimization
kono
parents: 656
diff changeset
160 fl = (struct flowi){ .oif = oif,
639db8597a58 decl_data optimization
kono
parents: 656
diff changeset
161 .iif = 55,
639db8597a58 decl_data optimization
kono
parents: 656
diff changeset
162 .nl_u = { .ip4_u = { .daddr = dst,
639db8597a58 decl_data optimization
kono
parents: 656
diff changeset
163 .saddr = 66,
639db8597a58 decl_data optimization
kono
parents: 656
diff changeset
164 .tos = tos } },
639db8597a58 decl_data optimization
kono
parents: 656
diff changeset
165 .proto = protocol,
639db8597a58 decl_data optimization
kono
parents: 656
diff changeset
166 .uli_u = { .ports =
639db8597a58 decl_data optimization
kono
parents: 656
diff changeset
167 { .sport = sport,
639db8597a58 decl_data optimization
kono
parents: 656
diff changeset
168 .dport = dport } } };
639db8597a58 decl_data optimization
kono
parents: 656
diff changeset
169 flp = &fl;
639db8597a58 decl_data optimization
kono
parents: 656
diff changeset
170
748
c2c709727221 i64 continue... basic.s assembled.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 694
diff changeset
171 printf("#0170:%x %x\n",flp->oif,flp->uli_u.ports.dport);
c2c709727221 i64 continue... basic.s assembled.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 694
diff changeset
172 printf("#0171:%x %x\n",flp->iif,flp->nl_u.ip4_u.saddr);
548
650717de878b *** empty log message ***
kono
parents: 547
diff changeset
173 }
650717de878b *** empty log message ***
kono
parents: 547
diff changeset
174
656
8320ae3ac186 inlined strinit
kono
parents: 655
diff changeset
175 INLINE void
547
9defd9459016 *** empty log message ***
kono
parents: 542
diff changeset
176 linux_kernel()
9defd9459016 *** empty log message ***
kono
parents: 542
diff changeset
177 {
684
6e2f1e7f9fc3 *** empty log message ***
kono
parents: 682
diff changeset
178 int i=1,j=2;
748
c2c709727221 i64 continue... basic.s assembled.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 694
diff changeset
179 printf("#0178:%d %d\n",i,j);
548
650717de878b *** empty log message ***
kono
parents: 547
diff changeset
180 ip_route_connect0(1,2,3,4,5,6,7);
547
9defd9459016 *** empty log message ***
kono
parents: 542
diff changeset
181 ip_route_connect(1,2,3,4,5,6,7);
548
650717de878b *** empty log message ***
kono
parents: 547
diff changeset
182 ip_route_connect(11,12,13,14,15,16,17);
682
639db8597a58 decl_data optimization
kono
parents: 656
diff changeset
183 ip_route_connect1(1,2,3,4,5,6,7);
547
9defd9459016 *** empty log message ***
kono
parents: 542
diff changeset
184 }
9defd9459016 *** empty log message ***
kono
parents: 542
diff changeset
185
608
c3ba27861c83 fix struct alignment in local init.
kono
parents: 573
diff changeset
186 struct st_child {
c3ba27861c83 fix struct alignment in local init.
kono
parents: 573
diff changeset
187 int a,b;
c3ba27861c83 fix struct alignment in local init.
kono
parents: 573
diff changeset
188 char c;
c3ba27861c83 fix struct alignment in local init.
kono
parents: 573
diff changeset
189 };
c3ba27861c83 fix struct alignment in local init.
kono
parents: 573
diff changeset
190
c3ba27861c83 fix struct alignment in local init.
kono
parents: 573
diff changeset
191 struct st_parent{
c3ba27861c83 fix struct alignment in local init.
kono
parents: 573
diff changeset
192 char ch;
c3ba27861c83 fix struct alignment in local init.
kono
parents: 573
diff changeset
193 struct st_child s1;
c3ba27861c83 fix struct alignment in local init.
kono
parents: 573
diff changeset
194 int i,j;
c3ba27861c83 fix struct alignment in local init.
kono
parents: 573
diff changeset
195 };
c3ba27861c83 fix struct alignment in local init.
kono
parents: 573
diff changeset
196
656
8320ae3ac186 inlined strinit
kono
parents: 655
diff changeset
197 INLINE void
608
c3ba27861c83 fix struct alignment in local init.
kono
parents: 573
diff changeset
198 main7()
c3ba27861c83 fix struct alignment in local init.
kono
parents: 573
diff changeset
199 {
c3ba27861c83 fix struct alignment in local init.
kono
parents: 573
diff changeset
200 struct st_parent st1 = {'A',{1,2,'E'},5,6};
c3ba27861c83 fix struct alignment in local init.
kono
parents: 573
diff changeset
201 struct st_child st2 = {10,11,'F'};
748
c2c709727221 i64 continue... basic.s assembled.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 694
diff changeset
202 printf("#0201:st1.ch = %c\n",st1.ch);
c2c709727221 i64 continue... basic.s assembled.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 694
diff changeset
203 printf("#0202:st1.s1.a = %d\n",st1.s1.a);
c2c709727221 i64 continue... basic.s assembled.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 694
diff changeset
204 printf("#0203:st1.s1.b = %d\n",st1.s1.b);
c2c709727221 i64 continue... basic.s assembled.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 694
diff changeset
205 printf("#0204:st1.s1.c = %c\n",st1.s1.c);
c2c709727221 i64 continue... basic.s assembled.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 694
diff changeset
206 printf("#0205:st1.i = %d\n",st1.i);
c2c709727221 i64 continue... basic.s assembled.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 694
diff changeset
207 printf("#0206:st1.j = %d\n\n",st1.j);
608
c3ba27861c83 fix struct alignment in local init.
kono
parents: 573
diff changeset
208
748
c2c709727221 i64 continue... basic.s assembled.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 694
diff changeset
209 printf("#0208:st2.a = %d\n",st2.a);
c2c709727221 i64 continue... basic.s assembled.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 694
diff changeset
210 printf("#0209:st2.b = %d\n",st2.b);
c2c709727221 i64 continue... basic.s assembled.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 694
diff changeset
211 printf("#0210:st2.c = %c\n",st2.c);
608
c3ba27861c83 fix struct alignment in local init.
kono
parents: 573
diff changeset
212
c3ba27861c83 fix struct alignment in local init.
kono
parents: 573
diff changeset
213 return;
c3ba27861c83 fix struct alignment in local init.
kono
parents: 573
diff changeset
214
c3ba27861c83 fix struct alignment in local init.
kono
parents: 573
diff changeset
215 }
c3ba27861c83 fix struct alignment in local init.
kono
parents: 573
diff changeset
216
655
cddab906095e struct init in function arg (or other expression).
kono
parents: 608
diff changeset
217
cddab906095e struct init in function arg (or other expression).
kono
parents: 608
diff changeset
218
cddab906095e struct init in function arg (or other expression).
kono
parents: 608
diff changeset
219 struct arg { int hage, fuga; int aho; };
cddab906095e struct init in function arg (or other expression).
kono
parents: 608
diff changeset
220
656
8320ae3ac186 inlined strinit
kono
parents: 655
diff changeset
221 INLINE void f(struct arg h) {
748
c2c709727221 i64 continue... basic.s assembled.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 694
diff changeset
222 printf("#0221:%d %d %d\n",h.hage,h.fuga,h.aho);
655
cddab906095e struct init in function arg (or other expression).
kono
parents: 608
diff changeset
223 }
cddab906095e struct init in function arg (or other expression).
kono
parents: 608
diff changeset
224
656
8320ae3ac186 inlined strinit
kono
parents: 655
diff changeset
225 INLINE int main8() {
655
cddab906095e struct init in function arg (or other expression).
kono
parents: 608
diff changeset
226 f((struct arg){.fuga = 3,.aho=5});
748
c2c709727221 i64 continue... basic.s assembled.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 694
diff changeset
227 printf("#0226:%d\n",((struct arg){.aho=120, .hage=55}).aho);
656
8320ae3ac186 inlined strinit
kono
parents: 655
diff changeset
228 }
8320ae3ac186 inlined strinit
kono
parents: 655
diff changeset
229
8320ae3ac186 inlined strinit
kono
parents: 655
diff changeset
230 int
8320ae3ac186 inlined strinit
kono
parents: 655
diff changeset
231 main()
8320ae3ac186 inlined strinit
kono
parents: 655
diff changeset
232 {
8320ae3ac186 inlined strinit
kono
parents: 655
diff changeset
233 struct temp temp2 = { .c = 5, .e=99 };
8320ae3ac186 inlined strinit
kono
parents: 655
diff changeset
234 #ifdef WRONG
8320ae3ac186 inlined strinit
kono
parents: 655
diff changeset
235 struct temp temp5 = { 1,2,3,4,5,6,7,8};
8320ae3ac186 inlined strinit
kono
parents: 655
diff changeset
236 struct temp temp6 = { 1,2,3,4,5,6};
8320ae3ac186 inlined strinit
kono
parents: 655
diff changeset
237 #else
8320ae3ac186 inlined strinit
kono
parents: 655
diff changeset
238 struct temp temp5 = { 1,2,3,4,5,6,7};
8320ae3ac186 inlined strinit
kono
parents: 655
diff changeset
239 struct temp temp6 = { 1,2,3,4,5,6,7};
8320ae3ac186 inlined strinit
kono
parents: 655
diff changeset
240 struct temp temp8 = { 1,2,3,4,{5,6},7};
8320ae3ac186 inlined strinit
kono
parents: 655
diff changeset
241 #endif
8320ae3ac186 inlined strinit
kono
parents: 655
diff changeset
242 struct temp temp11 = {
8320ae3ac186 inlined strinit
kono
parents: 655
diff changeset
243 .m = (struct hoge){},
770
b674d8421430 i64 inline ( indirect call )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 748
diff changeset
244 .c = (long)&b,
656
8320ae3ac186 inlined strinit
kono
parents: 655
diff changeset
245 };
8320ae3ac186 inlined strinit
kono
parents: 655
diff changeset
246 struct temp temp12 = {
8320ae3ac186 inlined strinit
kono
parents: 655
diff changeset
247 .m = (struct hoge){1,3},
770
b674d8421430 i64 inline ( indirect call )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 748
diff changeset
248 .c = (long)&temp4,
656
8320ae3ac186 inlined strinit
kono
parents: 655
diff changeset
249 };
694
edc024fc7472 *** empty log message ***
kono
parents: 684
diff changeset
250 int c[3] = {1,2,3};
656
8320ae3ac186 inlined strinit
kono
parents: 655
diff changeset
251
770
b674d8421430 i64 inline ( indirect call )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 748
diff changeset
252 printf("#0251:1: %ld\n",temp1.a);
b674d8421430 i64 inline ( indirect call )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 748
diff changeset
253 printf("#0252:1: %ld\n",temp1.e);
b674d8421430 i64 inline ( indirect call )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 748
diff changeset
254 printf("#0253:1: %ld\n",temp1.b);
b674d8421430 i64 inline ( indirect call )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 748
diff changeset
255 printf("#0254:2: %ld\n",temp2.c);
b674d8421430 i64 inline ( indirect call )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 748
diff changeset
256 printf("#0255:2: %ld\n",temp2.e);
b674d8421430 i64 inline ( indirect call )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 748
diff changeset
257 printf("#0256:2: %ld\n",temp2.b);
748
c2c709727221 i64 continue... basic.s assembled.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 694
diff changeset
258 printf("#0257:2: %d\n",(void*)temp3.c==b);
770
b674d8421430 i64 inline ( indirect call )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 748
diff changeset
259 printf("#0258:2: %d\n",temp3.c==(long)b);
b674d8421430 i64 inline ( indirect call )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 748
diff changeset
260 printf("#0259:2: %d\n",temp3.a==(long)&b);
b674d8421430 i64 inline ( indirect call )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 748
diff changeset
261 printf("#0260:2: %ld\n",temp4.m.j);
b674d8421430 i64 inline ( indirect call )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 748
diff changeset
262 printf("#0261:2: %ld\n",temp5.m.j);
b674d8421430 i64 inline ( indirect call )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 748
diff changeset
263 printf("#0262:2: %ld\n",temp11.m.j);
b674d8421430 i64 inline ( indirect call )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 748
diff changeset
264 printf("#0263:2: %ld\n",temp12.m.k);
b674d8421430 i64 inline ( indirect call )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 748
diff changeset
265 printf("#0264:2: %ld\n",temp12.m.j);
b674d8421430 i64 inline ( indirect call )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 748
diff changeset
266 printf("#0265:2: %d\n",temp11.c==(long)&b);
b674d8421430 i64 inline ( indirect call )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 748
diff changeset
267 printf("#0266:2: %ld\n",temp8.e);
b674d8421430 i64 inline ( indirect call )
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 748
diff changeset
268 printf("#0267:2: %ld\n",temp6.e);
656
8320ae3ac186 inlined strinit
kono
parents: 655
diff changeset
269 main7();
8320ae3ac186 inlined strinit
kono
parents: 655
diff changeset
270 main8();
8320ae3ac186 inlined strinit
kono
parents: 655
diff changeset
271 linux_kernel();
684
6e2f1e7f9fc3 *** empty log message ***
kono
parents: 682
diff changeset
272 int i=1,j=2;
748
c2c709727221 i64 continue... basic.s assembled.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 694
diff changeset
273 printf("#0272:%d %d\n",i,j);
694
edc024fc7472 *** empty log message ***
kono
parents: 684
diff changeset
274
748
c2c709727221 i64 continue... basic.s assembled.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 694
diff changeset
275 printf("#0274:b %d %d %d\n",b[0],b[1],b[2]);
c2c709727221 i64 continue... basic.s assembled.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 694
diff changeset
276 printf("#0275:c %d %d %d\n",c[0],c[1],c[2]);
694
edc024fc7472 *** empty log message ***
kono
parents: 684
diff changeset
277
edc024fc7472 *** empty log message ***
kono
parents: 684
diff changeset
278 struct test t = {1,2,3};
748
c2c709727221 i64 continue... basic.s assembled.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 694
diff changeset
279 printf("#0278:t %d %d %d\n",t.a,t.b,t.c);
694
edc024fc7472 *** empty log message ***
kono
parents: 684
diff changeset
280
edc024fc7472 *** empty log message ***
kono
parents: 684
diff changeset
281 struct test3 {
edc024fc7472 *** empty log message ***
kono
parents: 684
diff changeset
282 int a,b,c;
edc024fc7472 *** empty log message ***
kono
parents: 684
diff changeset
283 } *p, q, d = {
edc024fc7472 *** empty log message ***
kono
parents: 684
diff changeset
284 1,2,3,
edc024fc7472 *** empty log message ***
kono
parents: 684
diff changeset
285 };
748
c2c709727221 i64 continue... basic.s assembled.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 694
diff changeset
286 printf("#0285:d %d %d %d\n",d.a,d.b,d.c);
694
edc024fc7472 *** empty log message ***
kono
parents: 684
diff changeset
287 p = & (struct test3) {1,2,3};
748
c2c709727221 i64 continue... basic.s assembled.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 694
diff changeset
288 printf("#0287:p %d %d %d\n",p->a,p->b,p->c);
694
edc024fc7472 *** empty log message ***
kono
parents: 684
diff changeset
289 q = (struct test3) {1,2,3};
748
c2c709727221 i64 continue... basic.s assembled.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 694
diff changeset
290 printf("#0289:q %d %d %d\n",q.a,q.b,q.c);
694
edc024fc7472 *** empty log message ***
kono
parents: 684
diff changeset
291
edc024fc7472 *** empty log message ***
kono
parents: 684
diff changeset
292 struct test4 {
edc024fc7472 *** empty log message ***
kono
parents: 684
diff changeset
293 struct test5 {
edc024fc7472 *** empty log message ***
kono
parents: 684
diff changeset
294 int a,b,c;
edc024fc7472 *** empty log message ***
kono
parents: 684
diff changeset
295 } d;
edc024fc7472 *** empty log message ***
kono
parents: 684
diff changeset
296 } u = { .d = {1,2,3} };
edc024fc7472 *** empty log message ***
kono
parents: 684
diff changeset
297 struct test4 v = { .d = (struct test5){1,2,3} };
edc024fc7472 *** empty log message ***
kono
parents: 684
diff changeset
298
748
c2c709727221 i64 continue... basic.s assembled.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 694
diff changeset
299 printf("#0298:u %d %d %d\n",u.d.a,u.d.b,u.d.c);
694
edc024fc7472 *** empty log message ***
kono
parents: 684
diff changeset
300
748
c2c709727221 i64 continue... basic.s assembled.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 694
diff changeset
301 printf("#0300:v %d %d %d\n",v.d.a,v.d.b,v.d.c);
694
edc024fc7472 *** empty log message ***
kono
parents: 684
diff changeset
302
edc024fc7472 *** empty log message ***
kono
parents: 684
diff changeset
303
656
8320ae3ac186 inlined strinit
kono
parents: 655
diff changeset
304 return 0;
655
cddab906095e struct init in function arg (or other expression).
kono
parents: 608
diff changeset
305 }
cddab906095e struct init in function arg (or other expression).
kono
parents: 608
diff changeset
306
cddab906095e struct init in function arg (or other expression).
kono
parents: 608
diff changeset
307
cddab906095e struct init in function arg (or other expression).
kono
parents: 608
diff changeset
308
547
9defd9459016 *** empty log message ***
kono
parents: 542
diff changeset
309 // end