Debian Codegraph @

gcc/testsuite/gcc.target/loongarch/tls-extreme-macro.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-march=loongarch64 -mabi=lp64d -O2 -mcmodel=extreme -mtls-dialect=trad -fno-plt -mexplicit-relocs=none" } */
3 /* { dg-final { scan-assembler "test_le:.*la.tls.le\t\\\$r\[0-9\]+,\\\.L" { target tls_native } } } */
4 /* { dg-final { scan-assembler "test_ie:.*la.tls.ie\t\\\$r\[0-9\]+,\\\$r\[0-9\]+,\\\.L" { target tls_native } } } */
5 /* { dg-final { scan-assembler "test_ld:.*la.tls.ld\t\\\$r\[0-9\]+,\\\$r\[0-9\]+,\\\.L.*la.global\t\\\$r\[0-9\]+,\\\$r\[0-9\]+,__tls_get_addr" { target tls_native } } } */
6 /* { dg-final { scan-assembler "test_le:.*la.tls.gd\t\\\$r\[0-9\]+,\\\$r\[0-9\]+,\\\.L.*la.global\t\\\$r\[0-9\]+,\\\$r\[0-9\]+,__tls_get_addr" { target tls_native } } } */
7
8 __thread int c __attribute__ ((tls_model ("local-exec")));
9 __thread int d __attribute__ ((tls_model ("initial-exec")));
10 __thread int e __attribute__ ((tls_model ("local-dynamic")));
11 __thread int f __attribute__ ((tls_model ("global-dynamic")));
12
13 int
14 test_le (void)
15 {
16 return c;
17 }
18
19 int
20 test_ie (void)
21 {
22 return d;
23 }
24
25 int
26 test_ld (void)
27 {
28 return e;
29 }
30
31 int
32 test_gd (void)
33 {
34 return f;
35 }