1 ## Test the --subsystem option.
3 # RUN: yaml2obj %s -o %t.in.exe
5 # RUN: llvm-objcopy --subsystem=posix:7.4 --subsystem windows %t.in.exe %t.out.exe
6 # RUN: llvm-readobj --file-headers %t.out.exe | FileCheck %s --check-prefix=WIN74
8 # WIN74: MajorOperatingSystemVersion: 6
9 # WIN74: MinorOperatingSystemVersion: 0
10 # WIN74: MajorSubsystemVersion: 7
11 # WIN74: MinorSubsystemVersion: 4
12 # WIN74: Subsystem: IMAGE_SUBSYSTEM_WINDOWS_GUI
14 # RUN: llvm-objcopy --subsystem=posix:7.4 --subsystem windows:9 %t.in.exe %t.out.exe
15 # RUN: llvm-readobj --file-headers %t.out.exe | FileCheck %s --check-prefix=WIN90
17 # WIN90: MajorOperatingSystemVersion: 6
18 # WIN90: MinorOperatingSystemVersion: 0
19 # WIN90: MajorSubsystemVersion: 9
20 # WIN90: MinorSubsystemVersion: 0
21 # WIN90: Subsystem: IMAGE_SUBSYSTEM_WINDOWS_GUI
23 # RUN: not llvm-objcopy --subsystem=foobar %t.in.exe %t.err.exe 2>&1 | FileCheck %s --check-prefix=INVALID-SUBSYS
25 # INVALID-SUBSYS: 'foobar' is not a valid subsystem{{$}}
27 # RUN: not llvm-objcopy --subsystem=windows:foo %t.in.exe %t.err.exe 2>&1 | FileCheck %s --check-prefix=INVALID-MAJOR-NUMBER
28 # RUN: not llvm-objcopy --subsystem=windows:8.bar %t.in.exe %t.err.exe 2>&1 | FileCheck %s --check-prefix=INVALID-MINOR-NUMBER
30 # INVALID-MAJOR-NUMBER: 'foo' is not a valid subsystem major version
31 # INVALID-MINOR-NUMBER: 'bar' is not a valid subsystem minor version
35 AddressOfEntryPoint: 4096
37 SectionAlignment: 4096
39 MajorOperatingSystemVersion: 6
40 MinorOperatingSystemVersion: 0
43 MajorSubsystemVersion: 6
44 MinorSubsystemVersion: 0
45 Subsystem: IMAGE_SUBSYSTEM_WINDOWS_CUI
46 DLLCharacteristics: [ ]
47 SizeOfStackReserve: 1048576
48 SizeOfStackCommit: 4096
49 SizeOfHeapReserve: 1048576
50 SizeOfHeapCommit: 4096
52 Machine: IMAGE_FILE_MACHINE_AMD64