a.c (529B)
1 /* Thread-local variable read. Exercises: 2 * - the C frontend's _Thread_local storage-class accepting `int` 3 * - the codegen's TLS access sequence (ELF TLSLE on aa64/x64/rv64 4 * ELF; Mach-O TLVP descriptor + thunk call on aa64-macho) 5 * - the linker's TLS image / TLV section/binding handling 6 * 7 * No targets file: runs on every <arch>-<obj> tuple. Cases that fail 8 * today reveal which lane still needs codegen / linker work. */ 9 10 _Thread_local int tls_val = 7; 11 12 int test_main(void) { return tls_val == 7 ? 0 : 1; }