3 # RUN: llvm-mc -triple=x86_64-windows-gnu %s -filetype=obj -o %t.obj
4 # RUN: llvm-readobj --symbols %t.obj | FileCheck %s --check-prefix=SYMBOL
6 # RUN: lld-link -lldmingw -entry:main %t.obj -out:%t.exe -lldmap:%t.map -verbose
7 # RUN: llvm-readobj --sections %t.exe | FileCheck %s
12 # CHECK-LABEL: Name: .rdata (2E 72 64 61 74 61 00 00)
13 # This is the critical check to show that .xdata$foo was
14 # retained, while .xdata$bar wasn't. This *must* be 0x24
15 # (0x4 for the .xdata section and 0x20 for the
16 # .ctors/.dtors headers/ends).
17 # CHECK-NEXT: VirtualSize: 0x24
19 # Check that the weak symbols still are emitted as it was when the test was
20 # written, to make sure the test still actually tests what was intended.
24 # SYMBOL-NEXT: Value: 0
25 # SYMBOL-NEXT: Section: IMAGE_SYM_UNDEFINED (0)
26 # SYMBOL-NEXT: BaseType: Null (0x0)
27 # SYMBOL-NEXT: ComplexType: Null (0x0)
28 # SYMBOL-NEXT: StorageClass: WeakExternal (0x69)
29 # SYMBOL-NEXT: AuxSymbolCount: 1
30 # SYMBOL-NEXT: AuxWeakExternal {
31 # SYMBOL-NEXT: Linked: .weak.foo.default.main (19)
32 # SYMBOL-NEXT: Search: Alias (0x3)
42 # See associative-comdat-mingw.s for the general setup. Here, the leader
43 # symbols are weak, which causes the functions foo and bar to be undefined
44 # weak externals, while the actual leader symbols are named like
45 # .weak.foo.default.main.
47 .section .xdata$foo,"dr"
51 .section .xdata$bar,"dr"
55 .section .text$foo,"xr",discard,foo
60 .section .text$bar,"xr",discard,bar