Mercurial > hg > CbC > CbC_llvm
comparison lld/test/ELF/tls-mismatch.s @ 236:c4bab56944e8 llvm-original
LLVM 16
author | kono |
---|---|
date | Wed, 09 Nov 2022 17:45:10 +0900 |
parents | 0572611fdcc8 |
children |
comparison
equal
deleted
inserted
replaced
232:70dce7da266c | 236:c4bab56944e8 |
---|---|
7 # RUN: ld.lld %t1.o --start-lib %t.o --end-lib -o /dev/null | 7 # RUN: ld.lld %t1.o --start-lib %t.o --end-lib -o /dev/null |
8 | 8 |
9 ## The TLS definition mismatches a non-TLS reference. | 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.o | 10 # RUN: echo '.type tls1,@object; movq tls1,%rax' | llvm-mc -filetype=obj -triple=x86_64 - -o %t2.o |
11 # RUN: not ld.lld %t2.o %t.o -o /dev/null 2>&1 | FileCheck %s | 11 # RUN: not ld.lld %t2.o %t.o -o /dev/null 2>&1 | FileCheck %s |
12 ## We fail to flag the swapped case. | 12 # RUN: not ld.lld %t.o %t2.o -o /dev/null 2>&1 | FileCheck %s |
13 # RUN: ld.lld %t.o %t2.o -o /dev/null | |
14 | 13 |
15 ## We fail to flag the STT_NOTYPE reference. This usually happens with hand-written | 14 ## We fail to flag the STT_NOTYPE reference. This usually happens with hand-written |
16 ## assembly because compiler-generated code properly sets symbol types. | 15 ## assembly because compiler-generated code properly sets symbol types. |
17 # RUN: echo 'movq tls1,%rax' | llvm-mc -filetype=obj -triple=x86_64 - -o %t3.o | 16 # RUN: echo 'movq tls1,%rax' | llvm-mc -filetype=obj -triple=x86_64 - -o %t3.o |
18 # RUN: ld.lld %t3.o %t.o -o /dev/null | 17 # RUN: ld.lld %t3.o %t.o -o /dev/null |
19 | 18 |
20 ## Overriding a TLS definition with a non-TLS definition does not make sense. | 19 ## Overriding a TLS definition with a non-TLS definition does not make sense. |
21 # RUN: not ld.lld --defsym tls1=42 %t.o -o /dev/null 2>&1 | FileCheck %s | 20 ## We fail to flag this case. |
21 # RUN: ld.lld --defsym tls1=42 %t.o -o /dev/null 2>&1 | count 0 | |
22 | 22 |
23 ## Part of PR36049: This should probably be allowed. | 23 ## Part of PR36049: This should probably be allowed. |
24 # RUN: not ld.lld --defsym tls1=tls2 %t.o -o /dev/null 2>&1 | FileCheck %s | 24 # RUN: ld.lld --defsym tls1=tls2 %t.o -o /dev/null 2>&1 | count 0 |
25 | 25 |
26 ## An undefined symbol in module-level inline assembly of a bitcode file | 26 ## An undefined symbol in module-level inline assembly of a bitcode file |
27 ## is considered STT_NOTYPE. We should not error. | 27 ## is considered STT_NOTYPE. We should not error. |
28 # RUN: echo 'target triple = "x86_64-pc-linux-gnu" \ | 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" \ | 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.bc | 30 # RUN: module asm "movq tls1@GOTTPOFF(%rip), %rax"' | llvm-as - -o %t.bc |
31 # RUN: ld.lld %t.o %t.bc -o /dev/null | 31 # RUN: ld.lld %t.o %t.bc -o /dev/null |
32 # RUN: ld.lld %t.bc %t.o -o /dev/null | 32 # RUN: ld.lld %t.bc %t.o -o /dev/null |
33 | 33 |
34 # CHECK: error: TLS attribute mismatch: tls1 | 34 # CHECK: error: TLS attribute mismatch: tls1 |
35 # CHECK-NEXT: >>> in {{.*}}.tmp.o | |
36 # CHECK-NEXT: >>> in {{.*}} | |
35 | 37 |
36 .globl _start | 38 .globl _start |
37 _start: | 39 _start: |
38 addl $1, %fs:tls1@TPOFF | 40 addl $1, %fs:tls1@TPOFF |
39 addl $2, %fs:tls2@TPOFF | 41 addl $2, %fs:tls2@TPOFF |