3 struct big_struct
{ char a
[262144]; };
5 static const char str
[] = "abcdefghijklmnopqrstuvwxyz";
9 printf("tst_branch --");
16 void tst_void_ptr(void *pv
, int i
)
18 i
? *pv
: *pv
; // dr106
25 i
= i
<< 32; // illegal. just test
26 l
= l
<< 64; // illegal. just test
32 void tst_const_addr(void)
34 void *addr
= mmap ((void *)0x20000000, 4096, PROT_READ
| PROT_WRITE
, MAP_FIXED
| MAP_ANONYMOUS
, -1, 0);
35 if (addr
!= (void *) -1) {
36 *(int *)0x20000000 += 42;
42 struct zero_struct
{};
44 struct zero_struct
tst_zero_struct(void)
46 struct zero_struct ret
;
50 struct big_struct
tst_big(struct big_struct tst
)
55 void tst_adr (int (*fp
)(char *, const char *, ...))
58 (*fp
)(buf
, "%.0f", 5.0);
59 printf("tst_adr %s\n", buf
);
68 void tst_compare(void)
70 /* This failed on risc64 */
71 printf ("tst_compare: %s\n", tst() > 0 ? "error" : "ok");
75 struct S
{ int d
:24; int f
:14; } i
, j
;
81 printf("tst_pack: j.f = %d, i.f = %d\n", j
.f
, i
.f
);
86 signed char c
= (signed char) 0xaaaaaaaa;
87 int r
= (unsigned short) c
^ (signed char) 0x99999999;
88 printf ("schar to ushort cast: %x\n", r
);
94 struct big_struct big
;
98 tst_void_ptr(&big
.a
[0], 0);