brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.8 KiB · 4798799 Raw
50 lines · plain
1# REQUIRES: x862# RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t.o3# RUN: echo 'movq tls1@GOTTPOFF(%rip), %rax' | llvm-mc -filetype=obj -triple=x86_64 - -o %t1.o4# RUN: ld.lld %t1.o %t.o -o /dev/null5# RUN: ld.lld %t.o %t1.o -o /dev/null6# RUN: ld.lld --start-lib %t.o --end-lib %t1.o -o /dev/null7# RUN: ld.lld %t1.o --start-lib %t.o --end-lib -o /dev/null8 9## The TLS definition mismatches a non-TLS reference.10# RUN: echo '.type tls1,@object; movq tls1,%rax' | llvm-mc -filetype=obj -triple=x86_64 - -o %t2.o11# RUN: not ld.lld %t2.o %t.o -o /dev/null 2>&1 | FileCheck %s12# RUN: not ld.lld %t.o %t2.o -o /dev/null 2>&1 | FileCheck %s13 14## We fail to flag the STT_NOTYPE reference. This usually happens with hand-written15## assembly because compiler-generated code properly sets symbol types.16# RUN: echo 'movq tls1,%rax' | llvm-mc -filetype=obj -triple=x86_64 - -o %t3.o17# RUN: ld.lld %t3.o %t.o -o /dev/null18 19## Overriding a TLS definition with a non-TLS definition does not make sense.20## We fail to flag this case.21# RUN: ld.lld --defsym tls1=42 %t.o -o /dev/null 2>&1 | count 022 23## Part of PR36049: This should probably be allowed.24# RUN: ld.lld --defsym tls1=tls2 %t.o -o /dev/null 2>&1 | count 025 26## An undefined symbol in module-level inline assembly of a bitcode file27## is considered STT_NOTYPE. We should not error.28# RUN: echo 'target triple = "x86_64-pc-linux-gnu" \29# RUN:   target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" \30# RUN:   module asm "movq tls1@GOTTPOFF(%rip), %rax"' | llvm-as - -o %t.bc31# RUN: ld.lld %t.o %t.bc -o /dev/null32# RUN: ld.lld %t.bc %t.o -o /dev/null33 34# CHECK: error: TLS attribute mismatch: tls135# CHECK-NEXT: >>> in {{.*}}.tmp.o36# CHECK-NEXT: >>> in {{.*}}37 38.globl _start39_start:40  addl $1, %fs:tls1@TPOFF41  addl $2, %fs:tls2@TPOFF42 43.tbss44.globl tls1, tls245  .space 846tls1:47  .space 448tls2:49  .space 450