2 # RUN: llvm-mc -triple=x86_64-windows-gnu %s -filetype=obj -o %t.o
4 # RUN: lld-link -lldmingw %t.o -out:%t-default.exe 2>&1 | FileCheck -allow-empty -check-prefix=LINK %s
5 # RUN: lld-link -lldmingw %t.o -out:%t-cui.exe -subsystem:console 2>&1 | FileCheck -allow-empty -check-prefix=LINK %s
6 # RUN: lld-link -lldmingw %t.o -out:%t-gui.exe -subsystem:windows 2>&1 | FileCheck -allow-empty -check-prefix=LINK %s
8 # RUN: llvm-readobj --file-headers %t-default.exe | FileCheck -check-prefix=CUI %s
9 # RUN: llvm-readobj --file-headers %t-cui.exe | FileCheck -check-prefix=CUI %s
10 # RUN: llvm-readobj --file-headers %t-gui.exe | FileCheck -check-prefix=GUI %s
12 # Check that this doesn't print any warnings.
13 # LINK-NOT: found both wmain and main
15 # CUI: AddressOfEntryPoint: 0x1001
16 # CUI: Subsystem: IMAGE_SUBSYSTEM_WINDOWS_CUI (0x3)
18 # GUI: AddressOfEntryPoint: 0x1002
19 # GUI: Subsystem: IMAGE_SUBSYSTEM_WINDOWS_GUI (0x2)
24 .globl WinMainCRTStartup
25 # MinGW only uses the entry points above, these other ones aren't
29 .globl wmainCRTStartup
30 .globl wWinMainCRTStartup