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
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
21 .section .CRT$XCU,"dr",associative,main_global
29 movq assoc_global
(%rip
), %rax