]> git.saurik.com Git - apple/ld64.git/blob - unit-tests/test-cases/dead_strip-archive-weak/main.c
ld64-224.1.tar.gz
[apple/ld64.git] / unit-tests / test-cases / dead_strip-archive-weak / main.c
1
2 extern void loadme();
3
4 void good()
5 {
6 }
7
8 void bad()
9 {
10 }
11
12 // foo is first found be dead stripping here
13 // then the use of loadme causes libfoo.a(foo.o)
14 // to be loaded which overrides foo
15 __attribute__((weak)) void foo()
16 {
17 bad();
18 }
19
20 int main()
21 {
22 foo();
23 loadme();
24 return 0;
25 }
26
27