]> git.saurik.com Git - apple/ld64.git/blame - 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
CommitLineData
55e3d2f6
A
1
2extern void foo1();
3extern void foo2();
4extern void bar1();
5extern void bar2();
6
7extern int foo_data1;
8extern int foo_data2;
9extern int bar_data1;
10extern int bar_data2;
11
12
13
14// make external relocation to foo_data1 and bar_data1
15int* pfoo = &foo_data1;
16int* pbar = &bar_data1;
17
a645023d
A
18void* pfoo1;
19void* pbar1;
55e3d2f6
A
20
21int main (void)
22{
23 // make non-lazy reference to foo1 and bar1
a645023d
A
24 pfoo1 = &foo1;
25 pbar1 = &bar1;
26
27 // make lazy reference to foo2 and bar2
28 foo2();
29 bar2();
55e3d2f6
A
30
31 // make non-lazy reference to foo_data2 and bar_data2
32 return *pfoo + *pbar + foo_data2 + bar_data2;
33}
34