1 // RUN: %clang -c -o %t %s
2 // RUN: %llvm_jitlink %t
4 // Test that basic ELF TLS work by adding together TLSs with values
5 // 0, 1, and -1, and returning the result (0 for success). This setup
6 // tests both zero-initialized (.tbss) and non-zero-initialized
11 .globl main # -- Begin function main
23 leaq x@TLSGD(%rip), %rdi
27 callq __tls_get_addr@PLT
29 movl %eax, -24(%rbp) # 4-byte Spill
31 leaq y@TLSGD(%rip), %rdi
35 callq __tls_get_addr@PLT
37 movl -24(%rbp), %eax # 4-byte Reload
40 movl %eax, -20(%rbp) # 4-byte Spill
42 leaq z@TLSGD(%rip), %rdi
46 callq __tls_get_addr@PLT
48 movl -20(%rbp), %eax # 4-byte Reload
55 .size main, .Lfunc_end0-main
58 .section .tbss,"awT",@nobits
66 .section .tdata,"awT",@progbits
77 .long 4294967295 # 0xffffffff
80 .section ".note.GNU-stack","",@progbits