Debian Codegraph @

gcc/testsuite/gcc.dg/darwin-weakimport-3.c

raw
1 /* { dg-do compile { target *-*-darwin* } } */
2
3 /* Here we want to test if "foo" gets placed into a coalesced
4 section (it should not).
5
6 However, for i386, and PIC code we have a "get_pc thunk" that
7 is (correctly) placed in a coalesced section when using an older
8 linker - also unwind tables are emitted into coalesced.
9
10 With modern linkers this is moot, since even weak symbols
11 are emitted into the regular sections.
12
13 To avoid the unwind tables -fno-asynchronous-unwind-tables
14 and fno-unwind-tables (since EH contains coalesced data).
15 To ensure that we emit code for an older linker -mtarget-linker
16 To avoid the get_pc thunk optimise at least O1. */
17
18 /* { dg-options "-fno-asynchronous-unwind-tables -fno-unwind-tables -O1 -mtarget-linker 85.2" } */
19 /* { dg-require-weak "" } */
20
21 /* { dg-final { scan-assembler-not "coalesced" } } */
22
23 extern void foo(void) __attribute__((weak_import));
24
25 void foo(void)
26 {
27 }