File: struct-by-value-1_y.c

package info (click to toggle)
gcc-riscv64-unknown-elf 8.3.0.2019.08%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 680,956 kB
  • sloc: ansic: 3,237,715; cpp: 896,882; ada: 772,854; f90: 144,254; asm: 68,788; makefile: 67,456; sh: 29,743; exp: 28,045; objc: 15,273; fortran: 11,885; python: 7,369; pascal: 5,375; awk: 3,725; perl: 2,872; yacc: 316; xml: 311; ml: 285; lex: 198; haskell: 122
file content (43 lines) | stat: -rw-r--r-- 1,152 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#define T(N)							\
struct S##N { unsigned char i[N]; };				\
extern struct S##N g1s##N, g2s##N, g3s##N;			\
								\
extern void check##N (struct S##N x, int i);			\
extern void test2_##N (struct S##N s1, struct S##N s2);		\
								\
void								\
init##N (struct S##N *p, int i)					\
{								\
  int j;							\
  for (j = 0; j < N; j++)					\
    p->i[j] = i + j;						\
}								\
								\
void								\
checkg##N (void)						\
{								\
  check##N (g1s##N, 64);					\
  check##N (g2s##N, 128);					\
  check##N (g3s##N, 192);					\
}								\
								\
void								\
test##N (struct S##N s1, struct S##N s2,			\
			 struct S##N s3)			\
{								\
  check##N (s1, 64);						\
  check##N (s2, 128);						\
  check##N (s3, 192);						\
}

#ifndef SKIP_ZERO_ARRAY
T(0)
#endif
T(1) T(2) T(3) T(4) T(5) T(6) T(7)
T(8) T(9) T(10) T(11) T(12) T(13) T(14) T(15)
T(16) T(17) T(18) T(19) T(20) T(21) T(22) T(23)
T(24) T(25) T(26) T(27) T(28) T(29) T(30) T(31)
T(32) T(33) T(34) T(35) T(36) T(37) T(38) T(39)
T(40) T(41) T(42) T(43) T(44) T(45) T(46) T(47)
T(48) T(49) T(50) T(51) T(52) T(53) T(54) T(55)
T(56) T(57) T(58) T(59) T(60) T(61) T(62) T(63)