comparison gcc/testsuite/gcc.dg/darwin-weakimport-3.c @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 04ced10e8804
children
comparison
equal deleted inserted replaced
131:84e7813d76e9 145:1830386684a0
1 /* { dg-do compile { target *-*-darwin* } } */ 1 /* { dg-do compile { target *-*-darwin* } } */
2 /* { dg-options "-fno-asynchronous-unwind-tables" } */ 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 To ensure that we emit code for an older linker -mtarget-linker
15 To avoid the get_pc thunk optimise at least O1. */
16
17 /* { dg-options "-fno-asynchronous-unwind-tables -O1 -mtarget-linker 85.2" } */
3 /* { dg-require-weak "" } */ 18 /* { dg-require-weak "" } */
4 19
5 /* { dg-final { scan-assembler-not "coalesced" } } */ 20 /* { dg-final { scan-assembler-not "coalesced" } } */
6 21
7 extern void foo(void) __attribute__((weak_import)); 22 extern void foo(void) __attribute__((weak_import));