1 # RUN: yaml2obj %p/Inputs/ret42.yaml -o %t.obj
3 # RUN: rm -f %t.exe.manifest
4 # RUN: lld-link /out:%t.exe /entry:main %t.obj
5 # RUN: test ! -e %t.exe.manifest
7 # RUN: lld-link /manifest /out:%t.exe /entry:main %t.obj
8 # RUN: FileCheck -check-prefix=MANIFEST %s < %t.exe.manifest
10 MANIFEST: <?xml version="1.0" standalone="yes"?>
11 MANIFEST: <assembly xmlns="urn:schemas-microsoft-com:asm.v1"
12 MANIFEST: manifestVersion="1.0">
15 MANIFEST: <requestedPrivileges>
16 MANIFEST: <requestedExecutionLevel level='asInvoker' uiAccess='false'/>
17 MANIFEST: </requestedPrivileges>
19 MANIFEST: </trustInfo>
22 # RUN: lld-link /out:%t.exe /entry:main /manifest \
23 # RUN: /manifestuac:"level='requireAdministrator' uiAccess='true'" %t.obj
24 # RUN: FileCheck -check-prefix=UAC %s < %t.exe.manifest
26 UAC: <?xml version="1.0" standalone="yes"?>
27 UAC: <assembly xmlns="urn:schemas-microsoft-com:asm.v1"
28 UAC: manifestVersion="1.0">
31 UAC: <requestedPrivileges>
32 UAC: <requestedExecutionLevel level='requireAdministrator' uiAccess='true'/>
33 UAC: </requestedPrivileges>
38 # /manifestdependency implies /manifest. (/manifestuac doesn't.)
39 # RUN: lld-link /out:%t.exe /entry:main \
40 # RUN: /manifestdependency:"foo='bar'" %t.obj
41 # RUN: FileCheck -check-prefix=DEPENDENCY %s < %t.exe.manifest
43 DEPENDENCY: <?xml version="1.0" standalone="yes"?>
44 DEPENDENCY: <assembly xmlns="urn:schemas-microsoft-com:asm.v1"
45 DEPENDENCY: manifestVersion="1.0">
46 DEPENDENCY: <trustInfo>
47 DEPENDENCY: <security>
48 DEPENDENCY: <requestedPrivileges>
49 DEPENDENCY: <requestedExecutionLevel level='asInvoker' uiAccess='false'/>
50 DEPENDENCY: </requestedPrivileges>
51 DEPENDENCY: </security>
52 DEPENDENCY: </trustInfo>
53 DEPENDENCY: <dependency>
54 DEPENDENCY: <dependentAssembly>
55 DEPENDENCY: <assemblyIdentity foo='bar' />
56 DEPENDENCY: </dependentAssembly>
57 DEPENDENCY: </dependency>
58 DEPENDENCY: </assembly>
60 # RUN: lld-link /manifest /out:%t.exe /entry:main /manifestuac:no \
61 # RUN: /manifestdependency:"foo='bar'" %t.obj
62 # RUN: FileCheck -check-prefix=NOUAC %s < %t.exe.manifest
64 NOUAC: <?xml version="1.0" standalone="yes"?>
65 NOUAC: <assembly xmlns="urn:schemas-microsoft-com:asm.v1"
66 NOUAC: manifestVersion="1.0">
68 NOUAC: <dependentAssembly>
69 NOUAC: <assemblyIdentity foo='bar' />
70 NOUAC: </dependentAssembly>
74 # RUN: lld-link /manifest /out:%t.exe /entry:main /manifestuac:no %t.obj
75 # RUN: FileCheck -check-prefix=NOUACNODEP %s < %t.exe.manifest
77 NOUACNODEP: <?xml version="1.0" standalone="yes"?>
78 NOUACNODEP: <assembly xmlns="urn:schemas-microsoft-com:asm.v1"
79 NOUACNODEP: manifestVersion="1.0">
80 NOUACNODEP: </assembly>
82 # Several /manifestdependency: flags are naively dedup'd.
83 # RUN: lld-link /out:%t.exe /entry:main \
84 # RUN: /manifestdependency:"foo='bar'" \
85 # RUN: /manifestdependency:"foo='bar'" \
86 # RUN: /manifestdependency:"baz='quux'" \
88 # RUN: FileCheck -check-prefix=SEVERALDEPS %s < %t.exe.manifest
90 SEVERALDEPS: <?xml version="1.0" standalone="yes"?>
91 SEVERALDEPS: <assembly xmlns="urn:schemas-microsoft-com:asm.v1"
92 SEVERALDEPS: manifestVersion="1.0">
93 SEVERALDEPS: <trustInfo>
94 SEVERALDEPS: <security>
95 SEVERALDEPS: <requestedPrivileges>
96 SEVERALDEPS: <requestedExecutionLevel level='asInvoker' uiAccess='false'/>
97 SEVERALDEPS: </requestedPrivileges>
98 SEVERALDEPS: </security>
99 SEVERALDEPS: </trustInfo>
100 SEVERALDEPS: <dependency>
101 SEVERALDEPS: <dependentAssembly>
102 SEVERALDEPS: <assemblyIdentity foo='bar' />
103 SEVERALDEPS: </dependentAssembly>
104 SEVERALDEPS: <dependency>
105 SEVERALDEPS: <dependentAssembly>
106 SEVERALDEPS: <assemblyIdentity baz='quux' />
107 SEVERALDEPS: </dependentAssembly>
108 SEVERALDEPS: </dependency>
109 SEVERALDEPS: </assembly>
111 # /manifestdependency: flags can be in .drectve sections.
112 # RUN: yaml2obj %p/Inputs/manifestdependency-drectve.yaml -o %t.dir.obj
113 # RUN: rm %t.exe.manifest
114 # RUN: lld-link /out:%t.exe /entry:main \
115 # RUN: %t.obj %t.dir.obj
116 # RUN: FileCheck -check-prefix=SEVERALDEPS %s < %t.exe.manifest
118 # /manifestdependency: flags in .drectve sections are ignored with an
119 # explicit /manifest:no.
120 # RUN: rm %t.exe.manifest
121 # RUN: lld-link /out:%t.exe /entry:main /manifest:no \
122 # RUN: %t.obj %t.dir.obj
123 # RUN: test ! -e %t.exe.manifest
125 # Test that /manifestdependency: flags in .drectve sections work
126 # with /manifest:embed too.
127 # RUN: lld-link /out:%t.exe /entry:main /manifest:embed \
128 # RUN: %t.obj %t.dir.obj
129 # RUN: test ! -e %t.exe.manifest
130 # RUN: llvm-readobj --coff-resources %t.exe \
131 # RUN: | FileCheck --check-prefix EMBED %s
134 EMBED: 0000: 3C3F786D 6C207665 7273696F 6E3D2231 |<?xml version="1|
135 EMBED: 0010: 2E302220 7374616E 64616C6F 6E653D22 |.0" standalone="|
136 EMBED: 0020: 79657322 3F3E0A3C 61737365 6D626C79 |yes"?>.<assembly|
137 EMBED: 0030: 20786D6C 6E733D22 75726E3A 73636865 | xmlns="urn:sche|
138 EMBED: 0040: 6D61732D 6D696372 6F736F66 742D636F |mas-microsoft-co|
139 EMBED: 0050: 6D3A6173 6D2E7631 220A2020 20202020 |m:asm.v1". |
140 EMBED: 0060: 20202020 6D616E69 66657374 56657273 | manifestVers|
141 EMBED: 0070: 696F6E3D 22312E30 223E0A20 203C7472 |ion="1.0">. <tr|
142 EMBED: 0080: 75737449 6E666F3E 0A202020 203C7365 |ustInfo>. <se|
143 EMBED: 0090: 63757269 74793E0A 20202020 20203C72 |curity>. <r|
144 EMBED: 00A0: 65717565 73746564 50726976 696C6567 |equestedPrivileg|
145 EMBED: 00B0: 65733E0A 20202020 20202020 203C7265 |es>. <re|
146 EMBED: 00C0: 71756573 74656445 78656375 74696F6E |questedExecution|
147 EMBED: 00D0: 4C657665 6C206C65 76656C3D 27617349 |Level level='asI|
148 EMBED: 00E0: 6E766F6B 65722720 75694163 63657373 |nvoker' uiAccess|
149 EMBED: 00F0: 3D276661 6C736527 2F3E0A20 20202020 |='false'/>. |
150 EMBED: 0100: 203C2F72 65717565 73746564 50726976 | </requestedPriv|
151 EMBED: 0110: 696C6567 65733E0A 20202020 3C2F7365 |ileges>. </se|
152 EMBED: 0120: 63757269 74793E0A 20203C2F 74727573 |curity>. </trus|
153 EMBED: 0130: 74496E66 6F3E0A20 203C6465 70656E64 |tInfo>. <depend|
154 EMBED: 0140: 656E6379 3E0A2020 20203C64 6570656E |ency>. <depen|
155 EMBED: 0150: 64656E74 41737365 6D626C79 3E0A2020 |dentAssembly>. |
156 EMBED: 0160: 20202020 3C617373 656D626C 79496465 | <assemblyIde|
157 EMBED: 0170: 6E746974 7920666F 6F3D2762 61722720 |ntity foo='bar' |
158 EMBED: 0180: 2F3E0A20 2020203C 2F646570 656E6465 |/>. </depende|
159 EMBED: 0190: 6E744173 73656D62 6C793E0A 20203C2F |ntAssembly>. </|
160 EMBED: 01A0: 64657065 6E64656E 63793E0A 20203C64 |dependency>. <d|
161 EMBED: 01B0: 6570656E 64656E63 793E0A20 2020203C |ependency>. <|
162 EMBED: 01C0: 64657065 6E64656E 74417373 656D626C |dependentAssembl|
163 EMBED: 01D0: 793E0A20 20202020 203C6173 73656D62 |y>. <assemb|
164 EMBED: 01E0: 6C794964 656E7469 74792062 617A3D27 |lyIdentity baz='|
165 EMBED: 01F0: 71757578 27202F3E 0A202020 203C2F64 |quux' />. </d|
166 EMBED: 0200: 6570656E 64656E74 41737365 6D626C79 |ependentAssembly|
167 EMBED: 0210: 3E0A2020 3C2F6465 70656E64 656E6379 |>. </dependency|
168 EMBED: 0220: 3E0A3C2F 61737365 6D626C79 3E0A |>.</assembly>.|