]> git.saurik.com Git - apple/dyld.git/blob - testing/kernel-cache-tests/fixups-x86_64-unaligned/foo.c
dyld-851.27.tar.gz
[apple/dyld.git] / testing / kernel-cache-tests / fixups-x86_64-unaligned / foo.c
1
2 int g = 0;
3
4 static int func() {
5 return g;
6 }
7
8 struct __attribute__((packed)) __attribute__((aligned((4096)))) PackedS {
9 int i;
10 __typeof(&func) funcPtr; // aligned to 4
11 __typeof(&func) funcPtr2; // aligned to 4
12 int j;
13 int *p1; // aligned to 8
14 char k;
15 int *p2; // aligned to 1
16 };
17
18 struct PackedS ps = { 0, &func, &func, 0, &g, 0, &g };
19
20 struct PackedS ps_array[4] = {
21 { 0, &func, &func, 0, &g, 0, &g },
22 { 0, &func, &func, 0, &g, 0, &g },
23 { 0, &func, &func, 0, &g, 0, &g },
24 { 0, &func, &func, 0, &g, 0, &g }
25 };
26
27
28 int foo() {
29 return ps.funcPtr();
30 }