]> git.saurik.com Git - apple/dyld.git/blob - testing/kernel-cache-tests/fixups-arm64e/main.cpp
dyld-851.27.tar.gz
[apple/dyld.git] / testing / kernel-cache-tests / fixups-arm64e / main.cpp
1
2 int g = 0;
3
4 static int func() {
5 return g;
6 }
7
8 struct S {
9 __typeof(&func) funcPtr;
10 __typeof(&func) funcPtr2;
11 int *p1;
12 __attribute__((aligned((16384)))) __typeof(&func) funcPtr3;
13 int *p2;
14 };
15
16 S s = { &func, &func, &g, &func, &g };
17
18 struct __attribute__((packed)) PackedS {
19 int i;
20 __typeof(&func) funcPtr; // aligned to 4
21 __typeof(&func) funcPtr2; // aligned to 4
22 int j;
23 int *p1; // aligned to 8
24 int k;
25 int *p2; // aligned to 4
26 };
27
28 __attribute__((aligned((16384))))
29 PackedS ps = { 0, &func, &func, 0, &g, 0, &g };
30
31 extern "C" int _start() {
32 return s.funcPtr() + s.funcPtr2() + s.funcPtr3() + ps.funcPtr();
33 }