]> git.saurik.com Git - apple/ld64.git/blob - unit-tests/test-cases/weak_import-force/main.c
ld64-123.2.tar.gz
[apple/ld64.git] / unit-tests / test-cases / weak_import-force / main.c
1
2 extern void foo1();
3 extern void foo2();
4 extern void bar1();
5 extern void bar2();
6
7 extern int foo_data1;
8 extern int foo_data2;
9 extern int bar_data1;
10 extern int bar_data2;
11
12
13
14 // make external relocation to foo_data1 and bar_data1
15 int* pfoo = &foo_data1;
16 int* pbar = &bar_data1;
17
18 void* pfoo1;
19 void* pbar1;
20
21 int main (void)
22 {
23 // make non-lazy reference to foo1 and bar1
24 pfoo1 = &foo1;
25 pbar1 = &bar1;
26
27 // make lazy reference to foo2 and bar2
28 foo2();
29 bar2();
30
31 // make non-lazy reference to foo_data2 and bar_data2
32 return *pfoo + *pbar + foo_data2 + bar_data2;
33 }
34