1 # RUN: yaml2obj %p/Inputs/ret42.yaml -o %t.obj
3 # RUN: lld-link /out:%t.exe /entry:main %t.obj
4 # RUN: llvm-readobj --file-headers %t.exe | FileCheck -check-prefix=BIND %s
5 # RUN: lld-link /allowbind /out:%t.exe /entry:main %t.obj
6 # RUN: llvm-readobj --file-headers %t.exe | FileCheck -check-prefix=BIND %s
7 BIND-NOT: IMAGE_DLL_CHARACTERISTICS_NO_BIND
9 # RUN: lld-link /allowbind:no /out:%t.exe /entry:main %t.obj
10 # RUN: llvm-readobj --file-headers %t.exe | FileCheck -check-prefix=NOBIND %s
11 NOBIND: IMAGE_DLL_CHARACTERISTICS_NO_BIND
13 # RUN: lld-link /out:%t.exe /entry:main %t.obj
14 # RUN: llvm-readobj --file-headers %t.exe | FileCheck -check-prefix=ISO %s
15 # RUN: lld-link /allowisolation /out:%t.exe /entry:main %t.obj
16 # RUN: llvm-readobj --file-headers %t.exe | FileCheck -check-prefix=ISO %s
17 ISO-NOT: IMAGE_DLL_CHARACTERISTICS_NO_ISOLATION
19 # RUN: lld-link /allowisolation:no /out:%t.exe /entry:main %t.obj
20 # RUN: llvm-readobj --file-headers %t.exe | FileCheck -check-prefix=NOISO %s
21 NOISO: IMAGE_DLL_CHARACTERISTICS_NO_ISOLATION
23 # RUN: lld-link /out:%t.exe /entry:main %t.obj
24 # RUN: llvm-readobj --file-headers %t.exe | FileCheck -check-prefix=ENT %s
25 # RUN: lld-link /out:%t.exe /entry:main /highentropyva %t.obj
26 # RUN: llvm-readobj --file-headers %t.exe | FileCheck -check-prefix=ENT %s
27 ENT: IMAGE_DLL_CHARACTERISTICS_HIGH_ENTROPY_VA
29 # RUN: lld-link /out:%t.exe /highentropyva:no /out:%t.exe /entry:main %t.obj
30 # RUN: llvm-readobj --file-headers %t.exe | FileCheck -check-prefix=NOENT %s
31 NOENT-NOT: IMAGE_DLL_CHARACTERISTICS_HIGH_ENTROPY_VA
33 # RUN: lld-link /out:%t.exe /entry:main /integritycheck %t.obj
34 # RUN: llvm-readobj --file-headers %t.exe | FileCheck -check-prefix=INT %s
35 INT: IMAGE_DLL_CHARACTERISTICS_FORCE_INTEGRITY
37 # RUN: lld-link /out:%t.exe /entry:main %t.obj
38 # RUN: llvm-readobj --file-headers %t.exe | FileCheck -check-prefix=NOINT %s
39 # RUN: lld-link /out:%t.exe /integritycheck:no /out:%t.exe /entry:main %t.obj
40 # RUN: llvm-readobj --file-headers %t.exe | FileCheck -check-prefix=NOINT %s
41 NOINT-NOT: IMAGE_DLL_CHARACTERISTICS_FORCE_INTEGRITY
43 # RUN: lld-link /out:%t.exe /entry:main %t.obj
44 # RUN: llvm-readobj --file-headers %t.exe | FileCheck -check-prefix=NXCOMPAT %s
45 # RUN: lld-link /out:%t.exe /entry:main /nxcompat %t.obj
46 # RUN: llvm-readobj --file-headers %t.exe | FileCheck -check-prefix=NXCOMPAT %s
47 NXCOMPAT: IMAGE_DLL_CHARACTERISTICS_NX_COMPAT
49 # RUN: lld-link /out:%t.exe /nxcompat:no /out:%t.exe /entry:main %t.obj
50 # RUN: llvm-readobj --file-headers %t.exe | FileCheck -check-prefix=NONXCOMPAT %s
51 NONXCOMPAT-NOT: IMAGE_DLL_CHARACTERISTICS_NX_COMPAT
53 # RUN: lld-link /out:%t.exe /entry:main /cetcompat %t.obj
54 # RUN: llvm-readobj --coff-debug-directory %t.exe | FileCheck -check-prefix=CETCOMPAT %s
55 CETCOMPAT: IMAGE_DLL_CHARACTERISTICS_EX_CET_COMPAT
57 # RUN: lld-link /out:%t.exe /entry:main %t.obj
58 # RUN: llvm-readobj --coff-debug-directory %t.exe | FileCheck -check-prefix=NONCETCOMPAT %s
59 # RUN: lld-link /out:%t.exe /entry:main /cetcompat:no %t.obj
60 # RUN: llvm-readobj --coff-debug-directory %t.exe | FileCheck -check-prefix=NONCETCOMPAT %s
61 NONCETCOMPAT-NOT: IMAGE_DLL_CHARACTERISTICS_EX_CET_COMPAT
63 # RUN: lld-link /out:%t.exe /entry:main /swaprun:CD %t.obj
64 # RUN: llvm-readobj --file-headers %t.exe | FileCheck -check-prefix=SWAPCD %s
65 # RUN: lld-link /out:%t.exe /entry:main /swaprun:cd,net %t.obj
66 # RUN: llvm-readobj --file-headers %t.exe | FileCheck -check-prefix=SWAPCD %s
67 SWAPCD: IMAGE_FILE_REMOVABLE_RUN_FROM_SWAP
69 # RUN: lld-link /out:%t.exe /entry:main %t.obj
70 # RUN: llvm-readobj --file-headers %t.exe | FileCheck -check-prefix=NOSWAPCD %s
71 NOSWAPCD-NOT: IMAGE_FILE_REMOVABLE_RUN_FROM_SWAP
73 # RUN: lld-link /out:%t.exe /entry:main /swaprun:NeT %t.obj
74 # RUN: llvm-readobj --file-headers %t.exe | FileCheck -check-prefix=SWAPNET %s
75 # RUN: lld-link /out:%t.exe /entry:main /swaprun:net,cd,cd,net %t.obj
76 # RUN: llvm-readobj --file-headers %t.exe | FileCheck -check-prefix=SWAPNET %s
77 SWAPNET: IMAGE_FILE_NET_RUN_FROM_SWAP
79 # RUN: lld-link /out:%t.exe /entry:main %t.obj
80 # RUN: llvm-readobj --file-headers %t.exe | FileCheck -check-prefix=NOSWAPNET %s
81 NOSWAPNET-NOT: IMAGE_FILE_NET_RUN_FROM_SWAP
83 # RUN: not lld-link /out:%t.exe /entry:main /swaprun: %t.obj 2>&1 | \
84 # RUN: FileCheck -check-prefix=SWAPERR1 %s
85 # RUN: not lld-link /out:%t.exe /entry:main /swaprun:cd, %t.obj 2>&1 | \
86 # RUN: FileCheck -check-prefix=SWAPERR1 %s
87 # RUN: not lld-link /out:%t.exe /entry:main /swaprun:,, %t.obj 2>&1 | \
88 # RUN: FileCheck -check-prefix=SWAPERR1 %s
89 # RUN: not lld-link /out:%t.exe /entry:main /swaprun:,cd %t.obj 2>&1 | \
90 # RUN: FileCheck -check-prefix=SWAPERR1 %s
91 SWAPERR1: /swaprun: missing argument
93 # RUN: not lld-link /out:%t.exe /entry:main /swaprun:foo %t.obj 2>&1 | \
94 # RUN: FileCheck -check-prefix=SWAPERR2 %s
95 # RUN: not lld-link /out:%t.exe /entry:main /swaprun:cd,foo,net %t.obj 2>&1 | \
96 # RUN: FileCheck -check-prefix=SWAPERR2 %s
97 SWAPERR2: /swaprun: invalid argument: foo
99 # RUN: not lld-link /out:%t.exe /entry:main /swaprun:cdfoo,net %t.obj 2>&1 | \
100 # RUN: FileCheck -check-prefix=SWAPERR3 %s
101 SWAPERR3: /swaprun: invalid argument: cdfoo
103 # RUN: lld-link /out:%t.exe /entry:main %t.obj
104 # RUN: llvm-readobj --file-headers %t.exe | FileCheck -check-prefix=TSAWARE %s
105 # RUN: lld-link /out:%t.exe /entry:main /tsaware %t.obj
106 # RUN: llvm-readobj --file-headers %t.exe | FileCheck -check-prefix=TSAWARE %s
107 TSAWARE: IMAGE_DLL_CHARACTERISTICS_TERMINAL_SERVER_AWARE
109 # RUN: lld-link /tsaware:no /out:%t.exe /entry:main %t.obj
110 # RUN: llvm-readobj --file-headers %t.exe | FileCheck -check-prefix=NOTSAWARE %s
111 # RUN: lld-link /dll /out:%t.dll /entry:main %t.obj
112 # RUN: llvm-readobj --file-headers %t.dll | FileCheck -check-prefix=NOTSAWARE %s
113 # RUN: lld-link /tsaware /dll /out:%t.dll /entry:main %t.obj
114 # RUN: llvm-readobj --file-headers %t.dll | FileCheck -check-prefix=NOTSAWARE %s
115 NOTSAWARE-NOT: IMAGE_DLL_CHARACTERISTICS_TERMINAL_SERVER_AWARE