[LLD][COFF] Fix TypeServerSource matcher with more than one collision
[llvm-project.git] / lld / test / COFF / edata.s
blob4e3b9daf43630cce94772cb7132098b88f25068c
1 # REQUIRES: x86
3 # RUN: llvm-mc -filetype=obj -triple=x86_64-mingw32 -o %t.o %s
4 # RUN: lld-link -lldmingw -dll -out:%t.dll %t.o -entry:__ImageBase 2>&1 | FileCheck %s --allow-empty --check-prefix=NOWARNING
5 # RUN: llvm-readobj --coff-exports %t.dll | FileCheck %s
6 # RUN: lld-link -lldmingw -dll -out:%t.dll %t.o -entry:__ImageBase -export:otherfunc 2>&1 | FileCheck %s --check-prefix=WARNING
7 # RUN: llvm-readobj --coff-exports %t.dll | FileCheck %s
9 # Check that the export table contains the manually crafted content
10 # instead of the linker generated exports.
12 # CHECK: Export {
13 # CHECK-NEXT: Ordinal: 1
14 # CHECK-NEXT: Name: myfunc
15 # CHECK-NEXT: RVA:
16 # CHECK-NEXT: }
17 # CHECK-EMPTY:
19 # NOWARNING-NOT: warning
21 # WARNING: warning: literal .edata sections override exports
23 .text
24 .globl myfunc
25 myfunc:
26 ret
27 .globl otherfunc
28 otherfunc:
29 ret
31 // The object contains a manually crafted .edata section, which exports
32 // myfunc, not otherfunc.
33 .section .edata, "drw"
34 .align 4
35 exports:
36 .long 0 // ExportFlags
37 .long 0 // TimeDateStamp
38 .long 0 // MajorVersion + MinorVersion
39 .rva name // NameRVA
40 .long 1 // OrdinalBase
41 .long 1 // AddressTableEntries
42 .long 1 // NumberOfNamePointers
43 .rva functions // ExportAddressTableRVA
44 .rva names // NamePointerRVA
45 .rva nameordinals // OrdinalTableRVA
47 names:
48 .rva funcname_myfunc
50 nameordinals:
51 .short 0
53 functions:
54 .rva myfunc
55 .long 0
57 funcname_myfunc:
58 .asciz "myfunc"
60 name:
61 .asciz "mydll.dll"