--- /dev/null
+---
+header:
+ Machine: IMAGE_FILE_MACHINE_AMD64
+ Characteristics: []
+sections:
+ - Name: '.text$mn'
+ Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
+ Alignment: 16
+ SectionData: B82A000000C3
+ - Name: .data
+ Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ, IMAGE_SCN_MEM_WRITE ]
+ Alignment: 16
+ SectionData: ''
+symbols:
+ - Name: '.text$mn'
+ Value: 0
+ SectionNumber: 1
+ SimpleType: IMAGE_SYM_TYPE_NULL
+ ComplexType: IMAGE_SYM_DTYPE_NULL
+ StorageClass: IMAGE_SYM_CLASS_STATIC
+ SectionDefinition:
+ Length: 6
+ NumberOfRelocations: 0
+ NumberOfLinenumbers: 0
+ CheckSum: 0
+ Number: 0
+ - Name: .data
+ Value: 0
+ SectionNumber: 2
+ SimpleType: IMAGE_SYM_TYPE_NULL
+ ComplexType: IMAGE_SYM_DTYPE_NULL
+ StorageClass: IMAGE_SYM_CLASS_STATIC
+ SectionDefinition:
+ Length: 0
+ NumberOfRelocations: 0
+ NumberOfLinenumbers: 0
+ CheckSum: 0
+ Number: 0
+ - Name: mainCRTStartup
+ Value: 0
+ SectionNumber: 1
+ SimpleType: IMAGE_SYM_TYPE_NULL
+ ComplexType: IMAGE_SYM_DTYPE_FUNCTION
+ StorageClass: IMAGE_SYM_CLASS_EXTERNAL
+...
-# RUN: lld -flavor link2 /entry:main /out:%t.exe /subsystem:console \
-# RUN: %p/Inputs/ret42.obj
+# RUN: yaml2obj < %p/Inputs/ret42.yaml > %t.obj
+
+# RUN: lld -flavor link2 /out:%t.exe %t.obj
# RUN: llvm-readobj -file-headers %t.exe | FileCheck -check-prefix=DEFAULT %s
DEFAULT: ImageBase: 0x140000000
-# RUN: lld -flavor link2 /entry:main /out:%t.exe /subsystem:console \
-# RUN: /base:0x280000000 %p/Inputs/ret42.obj
+# RUN: lld -flavor link2 /out:%t.exe %t.obj /base:0x280000000
# RUN: llvm-readobj -file-headers %t.exe | FileCheck -check-prefix=BASE %s
BASE: ImageBase: 0x280000000
-# RUN: lld -flavor link2 /entry:main /subsystem:console /out:%t.exe \
-# RUN: %p/Inputs/ret42.obj
+# RUN: yaml2obj < %p/Inputs/ret42.yaml > %t.obj
+
+# RUN: lld -flavor link2 /out:%t.exe %t.obj
# RUN: llvm-readobj -file-headers %t.exe | FileCheck -check-prefix=DEFAULT %s
DEFAULT: SizeOfHeapReserve: 1048576
DEFAULT: SizeOfHeapCommit: 4096
-# RUN: lld -flavor link2 /entry:main /subsystem:console /out:%t.exe \
-# RUN: /heap:0x3000 %p/Inputs/ret42.obj
+# RUN: lld -flavor link2 /out:%t.exe /heap:0x3000 %t.obj
# RUN: llvm-readobj -file-headers %t.exe | FileCheck -check-prefix=CHECK1 %s
CHECK1: SizeOfHeapReserve: 12288
CHECK1: SizeOfHeapCommit: 4096
-# RUN: lld -flavor link2 /entry:main /subsystem:console /out:%t.exe \
-# RUN: /heap:0x5000,0x3000 %p/Inputs/ret42.obj
+# RUN: lld -flavor link2 /out:%t.exe /heap:0x5000,0x3000 %t.obj
# RUN: llvm-readobj -file-headers %t.exe | FileCheck -check-prefix=CHECK2 %s
CHECK2: SizeOfHeapReserve: 20480
-# RUN: yaml2obj %s > %t.obj
-# RUN: lld -flavor link2 /out:%t.exe /subsystem:console %t.obj
+# RUN: yaml2obj < %s > %t.obj
+# RUN: lld -flavor link2 /out:%t.exe %t.obj
# RUN: llvm-readobj -sections %t.exe | FileCheck %s
---
-# RUN: lld -flavor link2 /entry:main /subsystem:console /out:%t.exe \
-# RUN: %p/Inputs/ret42.obj
+# RUN: yaml2obj < %p/Inputs/ret42.yaml > %t.obj
+
+# RUN: lld -flavor link2 /out:%t.exe %t.obj
# RUN: llvm-readobj -file-headers %t.exe | FileCheck -check-prefix=DEFAULT %s
DEFAULT: SizeOfStackReserve: 1048576
DEFAULT: SizeOfStackCommit: 4096
-# RUN: lld -flavor link2 /entry:main /subsystem:console /out:%t.exe \
-# RUN: /stack:0x3000 %p/Inputs/ret42.obj
+# RUN: lld -flavor link2 /out:%t.exe %t.obj /stack:0x3000
# RUN: llvm-readobj -file-headers %t.exe | FileCheck -check-prefix=CHECK1 %s
CHECK1: SizeOfStackReserve: 12288
CHECK1: SizeOfStackCommit: 4096
-# RUN: lld -flavor link2 /entry:main /subsystem:console /out:%t.exe \
-# RUN: /stack:0x5000,0x3000 %p/Inputs/ret42.obj
+# RUN: lld -flavor link2 /out:%t.exe %t.obj /stack:0x5000,0x3000
# RUN: llvm-readobj -file-headers %t.exe | FileCheck -check-prefix=CHECK2 %s
CHECK2: SizeOfStackReserve: 20480
-# RUN: lld -flavor link2 /entry:main /subsystem:console /out:%t.exe \
-# RUN: %p/Inputs/ret42.obj
+# RUN: yaml2obj < %p/Inputs/ret42.yaml > %t.obj
+
+# RUN: lld -flavor link2 /out:%t.exe %t.obj
# RUN: llvm-readobj -file-headers %t.exe | FileCheck -check-prefix=DEFAULT %s
DEFAULT: MajorImageVersion: 0
DEFAULT: MinorImageVersion: 0
-# RUN: lld -flavor link2 /entry:main /subsystem:console /out:%t.exe \
-# RUN: /version:11 %p/Inputs/ret42.obj
+# RUN: lld -flavor link2 /out:%t.exe %t.obj /version:11
# RUN: llvm-readobj -file-headers %t.exe | FileCheck -check-prefix=CHECK1 %s
CHECK1: MajorImageVersion: 11
CHECK1: MinorImageVersion: 0
-# RUN: lld -flavor link2 /entry:main /subsystem:console /out:%t.exe \
-# RUN: /version:11.22 %p/Inputs/ret42.obj
+# RUN: lld -flavor link2 /out:%t.exe %t.obj /version:11.22
# RUN: llvm-readobj -file-headers %t.exe | FileCheck -check-prefix=CHECK2 %s
CHECK2: MajorImageVersion: 11