2 # RUN: llvm-mc -triple=x86_64-windows-msvc %s -filetype=obj -o %t1.obj
3 # RUN: llvm-mc -triple=x86_64-windows-msvc %S/Inputs/associative-comdat-2.s -filetype=obj -o %t2.obj
5 # RUN: lld-link -entry:main %t1.obj %t2.obj -out:%t.gc.exe
6 # RUN: llvm-readobj --sections %t.gc.exe | FileCheck %s
8 # RUN: lld-link -entry:main %t1.obj %t2.obj -opt:noref -out:%t.nogc.exe
9 # RUN: llvm-readobj --sections %t.nogc.exe | FileCheck %s
14 # CHECK-LABEL: Name: .rdata (2E 72 64 61 74 61 00 00)
15 # This is the critical check to show that only *one* definition of
16 # foo_assoc was retained. This *must* be 8, not 16.
17 # CHECK-NEXT: VirtualSize: 0x8
20 # CHECK-LABEL: Name: .data (2E 64 61 74 61 00 00 00)
21 # CHECK-NEXT: VirtualSize: 0x4
28 .globl main # -- Begin function main
36 # Defines foo and foo_assoc globals. foo is comdat, and foo_assoc is comdat
37 # associative with it. foo_assoc should be discarded iff foo is discarded,
38 # either by linker GC or normal comdat merging.
40 .section .rdata,"dr",associative,foo
44 .section .data,"dw",discard,foo