Debian Codegraph @

gcc/testsuite/gcc.target/loongarch/explicit-relocs-auto-lto.c

raw
1 /* { dg-do link } */
2 /* { dg-require-effective-target lto } */
3 /* { dg-require-linker-plugin "" } */
4 /* { dg-options "-fpic -shared -O2 --save-temps -mexplicit-relocs=auto -flto -fuse-linker-plugin -flto-partition=one" } */
5
6 int pcrel __attribute__ ((visibility ("hidden")));
7 int got __attribute__ ((visibility ("default")));
8
9 int
10 *addr_pcrel (void)
11 {
12 return &pcrel;
13 }
14
15 int
16 *addr_got (void)
17 {
18 return &got;
19 }
20
21 /* With linker plugin we should use la.local (it can be relaxed to pcaddi),
22 but not la.global (we are pretty sure the linker cannot relax la.global
23 got). */
24 /* { dg-final { scan-lto-assembler "la.local.*pcrel" } } */
25 /* { dg-final { scan-lto-assembler "pcalau12i.*%got_pc_hi20\\\(got\\\)" } } */
26 /* { dg-final { scan-lto-assembler "ld.*%got_pc_lo12\\\(got\\\)" } } */