llvm-project
115 строк · 5.8 Кб
1# RUN: yaml2obj %p/Inputs/ret42.yaml -o %t.obj
2
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
7BIND-NOT: IMAGE_DLL_CHARACTERISTICS_NO_BIND
8
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
11NOBIND: IMAGE_DLL_CHARACTERISTICS_NO_BIND
12
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
17ISO-NOT: IMAGE_DLL_CHARACTERISTICS_NO_ISOLATION
18
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
21NOISO: IMAGE_DLL_CHARACTERISTICS_NO_ISOLATION
22
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
27ENT: IMAGE_DLL_CHARACTERISTICS_HIGH_ENTROPY_VA
28
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
31NOENT-NOT: IMAGE_DLL_CHARACTERISTICS_HIGH_ENTROPY_VA
32
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
35INT: IMAGE_DLL_CHARACTERISTICS_FORCE_INTEGRITY
36
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
41NOINT-NOT: IMAGE_DLL_CHARACTERISTICS_FORCE_INTEGRITY
42
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
47NXCOMPAT: IMAGE_DLL_CHARACTERISTICS_NX_COMPAT
48
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
51NONXCOMPAT-NOT: IMAGE_DLL_CHARACTERISTICS_NX_COMPAT
52
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
55CETCOMPAT: IMAGE_DLL_CHARACTERISTICS_EX_CET_COMPAT
56
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
61NONCETCOMPAT-NOT: IMAGE_DLL_CHARACTERISTICS_EX_CET_COMPAT
62
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
67SWAPCD: IMAGE_FILE_REMOVABLE_RUN_FROM_SWAP
68
69# RUN: lld-link /out:%t.exe /entry:main %t.obj
70# RUN: llvm-readobj --file-headers %t.exe | FileCheck -check-prefix=NOSWAPCD %s
71NOSWAPCD-NOT: IMAGE_FILE_REMOVABLE_RUN_FROM_SWAP
72
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
77SWAPNET: IMAGE_FILE_NET_RUN_FROM_SWAP
78
79# RUN: lld-link /out:%t.exe /entry:main %t.obj
80# RUN: llvm-readobj --file-headers %t.exe | FileCheck -check-prefix=NOSWAPNET %s
81NOSWAPNET-NOT: IMAGE_FILE_NET_RUN_FROM_SWAP
82
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
91SWAPERR1: /swaprun: missing argument
92
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
97SWAPERR2: /swaprun: invalid argument: foo
98
99# RUN: not lld-link /out:%t.exe /entry:main /swaprun:cdfoo,net %t.obj 2>&1 | \
100# RUN: FileCheck -check-prefix=SWAPERR3 %s
101SWAPERR3: /swaprun: invalid argument: cdfoo
102
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
107TSAWARE: IMAGE_DLL_CHARACTERISTICS_TERMINAL_SERVER_AWARE
108
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
115NOTSAWARE-NOT: IMAGE_DLL_CHARACTERISTICS_TERMINAL_SERVER_AWARE
116