Rename CODE_OWNERS -> Maintainers (#114544)
[llvm-project.git] / lld / test / COFF / reloc-discarded.s
blob378804b623128c483cddf2f1168f6f3e475d137b
1 # REQUIRES: x86
2 # RUN: echo -e '.section .bss,"bw",discard,main_global\n.global main_global\n main_global:\n .long 0' | \
3 # RUN: llvm-mc - -filetype=obj -o %t1.obj -triple x86_64-windows-msvc
4 # RUN: llvm-mc %s -filetype=obj -o %t2.obj -triple x86_64-windows-msvc
6 # LLD should report an error and not assert regardless of whether we are doing
7 # GC.
9 # RUN: not lld-link -entry:main -nodefaultlib %t1.obj %t2.obj -out:%t.exe -opt:ref 2>&1 | FileCheck %s
10 # RUN: not lld-link -entry:main -nodefaultlib %t1.obj %t2.obj -out:%t.exe -opt:noref 2>&1 | FileCheck %s
12 # CHECK: error: relocation against symbol in discarded section: assoc_global
13 # CHECK: >>> referenced by {{.*}}reloc-discarded{{.*}}.obj:(main)
15 .section .bss,"bw",discard,main_global
16 .globl main_global
17 .p2align 2
18 main_global:
19 .long 0
21 .section .CRT$XCU,"dr",associative,main_global
22 .p2align 3
23 assoc_global:
24 .quad main_global
26 .text
27 .globl main
28 main:
29 movq assoc_global(%rip), %rax
30 movl (%rax), %eax
31 retq