8 char* x = strdup("hello");
9 char c __attribute__((unused));
10 char c0[8], c1[8], c2[8], c3[8], c4[8];
12 // Each of these pointers has a different alignment
13 char** p0 = (char**)&c0[0]; char** p1 = (char**)&c1[1];
14 char** p2 = (char**)&c2[2]; char** p3 = (char**)&c3[3];
15 char** p4 = (char**)&c4[4];
16 *p0 = x; *p1 = x; *p2 = x;
33 c = (*p0)[-1]; // always word aligned, so det
34 c = (*p1)[-1]; // undet
35 c = (*p2)[-1]; // undet
36 c = (*p3)[-1]; // undet
37 c = (*p4)[-1]; // undet on 64-bit since not 64-bit aligned
39 c = (*p0)[6]; // always word aligned, so det
40 c = (*p1)[6]; // undet
41 c = (*p2)[6]; // undet
42 c = (*p3)[6]; // undet
43 c = (*p4)[6]; // undet on 64-bit since not 64-bit aligned
48 /* What this program does: verifies that (unfortunately) if you store a
49 pointer misaligned, then the associated shadow value decays to Unknown,
50 and so when you retrieve the pointer later and dereference it, you