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
12 .globl main # -- Begin function main
18 addis 2, 12, .TOC.-.Lfunc_gep0@ha
19 addi 2, 2, .TOC.-.Lfunc_gep0@l
21 .localentry main, .Lfunc_lep0-.Lfunc_gep0
24 std 30, -16(1) # 8-byte Folded Spill
26 addis 3, 2, x@got@tlsgd@ha
28 addi 3, 3, x@got@tlsgd@l
29 bl __tls_get_addr(x@tlsgd)
32 addis 3, 2, y@got@tlsgd@ha
33 addi 3, 3, y@got@tlsgd@l
34 bl __tls_get_addr(y@tlsgd)
37 addis 4, 2, z@got@tlsgd@ha
39 addi 3, 4, z@got@tlsgd@l
40 bl __tls_get_addr(z@tlsgd)
47 ld 30, -16(1) # 8-byte Folded Reload
53 .size main, .Lfunc_end0-.Lfunc_begin0
56 .section .tbss,"awT",@nobits
64 .section .tdata,"awT",@progbits
75 .long 4294967295 # 0xffffffff