Rename CODE_OWNERS -> Maintainers (#114544)
[llvm-project.git] / lld / test / COFF / locally-imported.test
blob1a2144d759af243c323ef0d8e6cf3fd727993042
1 # RUN: yaml2obj %s -o %t.obj
2 # RUN: lld-link /out:%t.exe /entry:main %t.obj 2>&1 | FileCheck -check-prefix=WARN %s
3 # RUN: llvm-objdump -s %t.exe | FileCheck %s
4 # RUN: llvm-readobj --coff-basereloc %t.exe | FileCheck -check-prefix=BASEREL %s
6 # WARN: warning: [[INPUT:.+]]: locally defined symbol imported: main (defined in [[INPUT]])
8 # CHECK:      Contents of section .text:
9 # CHECK-NEXT: 1000 00200000
10 # CHECK:      Contents of section .rdata:
11 # CHECK-NEXT: 2000 04100040 01000000
13 # BASEREL:      BaseReloc [
14 # BASEREL-NEXT:   Entry {
15 # BASEREL-NEXT:     Type: DIR64
16 # BASEREL-NEXT:     Address: 0x2000
17 # BASEREL-NEXT:   }
18 # BASEREL-NEXT:   Entry {
19 # BASEREL-NEXT:     Type: ABSOLUTE
20 # BASEREL-NEXT:     Address: 0x2000
21 # BASEREL-NEXT:   }
22 # BASEREL-NEXT: ]
24 --- !COFF
25 header:
26   Machine:         IMAGE_FILE_MACHINE_AMD64
27   Characteristics: []
28 sections:
29   - Name:            .text
30     Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
31     Alignment:       4
32     SectionData:     00000000
33     Relocations:
34       - VirtualAddress:  0
35         SymbolName:      __imp_main
36         Type:            IMAGE_REL_AMD64_ADDR32NB
37 symbols:
38   - Name:            .text
39     Value:           0
40     SectionNumber:   1
41     SimpleType:      IMAGE_SYM_TYPE_NULL
42     ComplexType:     IMAGE_SYM_DTYPE_NULL
43     StorageClass:    IMAGE_SYM_CLASS_STATIC
44     SectionDefinition:
45       Length:          4
46       NumberOfRelocations: 1
47       NumberOfLinenumbers: 0
48       CheckSum:        0
49       Number:          0
50       Selection:       IMAGE_COMDAT_SELECT_ANY
51   - Name:            main
52     Value:           4
53     SectionNumber:   1
54     SimpleType:      IMAGE_SYM_TYPE_NULL
55     ComplexType:     IMAGE_SYM_DTYPE_FUNCTION
56     StorageClass:    IMAGE_SYM_CLASS_EXTERNAL
57   - Name:            __imp_main
58     Value:           0
59     SectionNumber:   0
60     SimpleType:      IMAGE_SYM_TYPE_NULL
61     ComplexType:     IMAGE_SYM_DTYPE_FUNCTION
62     StorageClass:    IMAGE_SYM_CLASS_EXTERNAL
63 ...