6 int* x3 = malloc(3); float f __attribute__((unused)), *f3 = malloc(3);
7 int* x4 = malloc(4); double d __attribute__((unused)), *d7 = malloc(7);
8 int* x5 = malloc(5); long long int lli __attribute__((unused)), *lli7 = malloc(7);
9 int* x6 = malloc(6); char c __attribute__((unused)), *c0 = malloc(0);
10 int* x7 = malloc(7); short int s __attribute__((unused)), *s1 = malloc(1);
11 int x __attribute__((unused));
17 #define ADDB(ptr, n) ((int*)(((unsigned long)(ptr)) + (n)))
19 // All these overrun by a single byte; the reads are happening at
20 // different alignments.
21 x = * ADDB(x3,0); // ok if --partial-loads-ok=yes
25 x = * ADDB(x7,4); // ok if --partial-loads-ok=yes
33 // These are all bad, at different points along
34 x = * ADDB(x3,-1); // before
35 x = * ADDB(x3, 0); // inside // ok if --partial-loads-ok=yes ...
36 x = * ADDB(x3, 1); // inside // ... but only on 32 bit platforms
37 x = * ADDB(x3, 2); // inside // ... ditto
38 x = * ADDB(x3, 3); // after
41 f = * f3; // ok if --partial-loads-ok=yes // ... ditto
43 lli = * lli7; // ok if --partial-loads-ok=yes see XXX below
50 /* Note re XXX, this gives different behaviour on 32 and 64 bit
51 platforms, because on 64-bit it's one load whereas as on 32 bit
52 platforms it's necessarily 2 32-bit loads, and the first one is OK. */