2021-05-11 16:35:13 -05:00
|
|
|
// RUN: %clang_cc1 -triple powerpc64-unknown-aix -target-cpu pwr8 -verify -fsyntax-only %s
|
|
|
|
// RUN: %clang_cc1 -triple powerpc-unknown-aix -target-cpu pwr8 -verify -fsyntax-only %s
|
|
|
|
|
|
|
|
#if !__has_attribute(tls_model)
|
|
|
|
#error "Should support tls_model attribute"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
static __thread int y __attribute((tls_model("global-dynamic"))); // no-warning
|
[PowerPC] Support local-dynamic TLS relocation on AIX (#66316)
Supports TLS local-dynamic on AIX, generates below sequence of code:
```
.tc foo[TC],foo[TL]@ld # Variable offset, ld relocation specifier
.tc mh[TC],mh[TC]@ml # Module handle for the caller
lwz 3,mh[TC]\(2\) $$ For 64-bit: ld 3,mh[TC]\(2\)
bla .__tls_get_mod # Modifies r0,r3,r4,r5,r11,lr,cr0
#r3 = &TLS for module
lwz 4,foo[TC]\(2\) $$ For 64-bit: ld 4,foo[TC]\(2\)
add 5,3,4 # Compute &foo
.rename mh[TC], "\_$TLSML" # Symbol for the module handle must have the name "_$TLSML"
```
---------
Co-authored-by: tingwang <tingwang@tingwangs-MBP.lan>
Co-authored-by: tingwang <tingwang@tingwangs-MacBook-Pro.local>
2024-03-01 08:09:40 +08:00
|
|
|
static __thread int y __attribute((tls_model("local-dynamic"))); // expected-no-diagnostics
|
2023-09-05 10:57:37 +08:00
|
|
|
static __thread int y __attribute((tls_model("initial-exec"))); // no-warning
|
2023-06-17 00:31:35 -05:00
|
|
|
static __thread int y __attribute((tls_model("local-exec"))); // no-warning
|