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 5 6# LLD should report an error and not assert regardless of whether we are doing 7# GC. 8 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 11 12# CHECK: error: relocation against symbol in discarded section: assoc_global 13# CHECK: >>> referenced by {{.*}}reloc-discarded{{.*}}.obj:(main) 14 15 .section .bss,"bw",discard,main_global 16 .globl main_global 17 .p2align 2 18main_global: 19 .long 0 20 21 .section .CRT$XCU,"dr",associative,main_global 22 .p2align 3 23assoc_global: 24 .quad main_global 25 26 .text 27 .globl main 28main: 29 movq assoc_global(%rip), %rax 30 movl (%rax), %eax 31 retq 32