1# RUN: sed -e s/ENTRYNAME/main/ %s | yaml2obj > %t.obj
2# RUN: not lld-link /out:%t.exe %t.obj > %t.log 2>&1
3# RUN: FileCheck -check-prefix=MAIN %s < %t.log
4# RUN: not lld-link /nodefaultlib /out:%t.exe %t.obj > %t.log 2>&1
5# RUN: FileCheck -check-prefix=MAIN %s < %t.log
6
7# Entry inference should work through /wholearchive:, they are also inputs.
8# RUN: lld-link /lib %t.obj /out:%t.lib
9# RUN: not lld-link /nodefaultlib /out:%t.exe /wholearchive:%t.lib > %t.log 2>&1
10# RUN: FileCheck -check-prefix=MAIN %s < %t.log
11
12# RUN: sed s/ENTRYNAME/wmain/ %s | yaml2obj > %t.obj
13# RUN: not lld-link /out:%t.exe %t.obj > %t.log 2>&1
14# RUN: FileCheck -check-prefix=WMAIN %s < %t.log
15# RUN: not lld-link /nodefaultlib /out:%t.exe %t.obj > %t.log 2>&1
16# RUN: FileCheck -check-prefix=WMAIN %s < %t.log
17
18# RUN: sed s/ENTRYNAME/WinMain/ %s | yaml2obj > %t.obj
19# RUN: not lld-link /out:%t.exe %t.obj > %t.log 2>&1
20# RUN: FileCheck -check-prefix=WINMAIN %s < %t.log
21# RUN: not lld-link /nodefaultlib /out:%t.exe %t.obj > %t.log 2>&1
22# RUN: FileCheck -check-prefix=WINMAIN %s < %t.log
23
24# RUN: sed s/ENTRYNAME/wWinMain/ %s | yaml2obj > %t.obj
25# RUN: not lld-link /out:%t.exe %t.obj > %t.log 2>&1
26# RUN: FileCheck -check-prefix=WWINMAIN %s < %t.log
27# RUN: not lld-link /nodefaultlib /out:%t.exe %t.obj > %t.log 2>&1
28# RUN: FileCheck -check-prefix=WWINMAIN %s < %t.log
29
30# MAIN:     error: <root>: undefined symbol: mainCRTStartup
31# WMAIN:    error: <root>: undefined symbol: wmainCRTStartup
32# WINMAIN:  error: <root>: undefined symbol: WinMainCRTStartup
33# WWINMAIN: error: <root>: undefined symbol: wWinMainCRTStartup
34
35--- !COFF
36header:
37  Machine:         IMAGE_FILE_MACHINE_AMD64
38  Characteristics: []
39sections:
40  - Name:            .text
41    Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
42    Alignment:       4
43    SectionData:     B82A000000C3
44symbols:
45  - Name:            .text
46    Value:           0
47    SectionNumber:   1
48    SimpleType:      IMAGE_SYM_TYPE_NULL
49    ComplexType:     IMAGE_SYM_DTYPE_NULL
50    StorageClass:    IMAGE_SYM_CLASS_STATIC
51    SectionDefinition:
52      Length:          6
53      NumberOfRelocations: 0
54      NumberOfLinenumbers: 0
55      CheckSum:        0
56      Number:          0
57  - Name:            ENTRYNAME
58    Value:           0
59    SectionNumber:   1
60    SimpleType:      IMAGE_SYM_TYPE_NULL
61    ComplexType:     IMAGE_SYM_DTYPE_NULL
62    StorageClass:    IMAGE_SYM_CLASS_EXTERNAL
63...
64