[clang-tidy][modernize-use-starts-ends-with] Fix operator rewriting false negative...
[llvm-project.git] / lld / test / ELF / comdat-discarded-error.s
blobf7ff635a0812d492c2d812ecc53af9394716891d
1 # REQUIRES: x86
2 # RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t1.o
3 # RUN: echo '.section .text.foo,"axG",@progbits,foo,comdat; .globl foo; foo:' |\
4 # RUN: llvm-mc -filetype=obj -triple=x86_64 - -o %t2.o
5 # RUN: echo '.weak foo; foo: .section .text.foo,"axG",@progbits,foo,comdat; .globl bar; bar:' |\
6 # RUN: llvm-mc -filetype=obj -triple=x86_64 - -o %t3.o
8 # RUN: not ld.lld --threads=1 %t2.o %t3.o %t1.o -o /dev/null 2>&1 | FileCheck %s
10 # CHECK: error: relocation refers to a symbol in a discarded section: bar
11 # CHECK-NEXT: >>> defined in {{.*}}3.o
12 # CHECK-NEXT: >>> section group signature: foo
13 # CHECK-NEXT: >>> prevailing definition is in {{.*}}2.o
14 # CHECK-NEXT: >>> or the symbol in the prevailing group {{.*}}
15 # CHECK-NEXT: >>> referenced by {{.*}}1.o:(.text+0x1)
17 # CHECK: error: relocation refers to a discarded section: .text.foo
18 # CHECK-NEXT: >>> defined in {{.*}}1.o
19 # CHECK-NEXT: >>> section group signature: foo
20 # CHECK-NEXT: >>> prevailing definition is in {{.*}}2.o
21 # CHECK-NEXT: >>> referenced by {{.*}}1.o:(.data+0x0)
23 .globl _start
24 _start:
25 jmp bar
27 .section .text.foo,"axG",@progbits,foo,comdat
28 .globl foo
29 foo:
30 .data
31 .quad .text.foo