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) {
37 *(int *)0x20000000 += 42;
44 struct zero_struct
{};
46 struct zero_struct
tst_zero_struct(void)
48 struct zero_struct ret
;
52 struct big_struct
tst_big(struct big_struct tst
)
57 void tst_adr (int (*fp
)(char *, const char *, ...))
60 (*fp
)(buf
, "%.0f", 5.0);
61 printf("tst_adr %s\n", buf
);
70 void tst_compare(void)
72 /* This failed on risc64 */
73 printf ("tst_compare: %s\n", tst() > 0 ? "error" : "ok");
77 struct S
{ int d
:24; int f
:14; } i
, j
;
83 printf("tst_pack: j.f = %d, i.f = %d\n", j
.f
, i
.f
);
88 signed char c
= (signed char) 0xaaaaaaaa;
89 int r
= (unsigned short) c
^ (signed char) 0x99999999;
90 printf ("schar to ushort cast: %x\n", r
);
96 struct big_struct big
;
100 tst_void_ptr(&big
.a
[0], 0);