173 lines · plain
1# RUN: yaml2obj %p/Inputs/ret42.yaml -o %t.obj2 3# RUN: rm -f %t.exe.manifest4# RUN: lld-link /out:%t.exe /entry:main %t.obj5# RUN: test ! -e %t.exe.manifest6 7# RUN: lld-link /manifest /out:%t.exe /entry:main %t.obj8# RUN: FileCheck -check-prefix=MANIFEST %s < %t.exe.manifest9 10MANIFEST: <?xml version="1.0" standalone="yes"?>11MANIFEST: <assembly xmlns="urn:schemas-microsoft-com:asm.v1"12MANIFEST: manifestVersion="1.0">13MANIFEST: <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">14MANIFEST: <security>15MANIFEST: <requestedPrivileges>16MANIFEST: <requestedExecutionLevel level='asInvoker' uiAccess='false'/>17MANIFEST: </requestedPrivileges>18MANIFEST: </security>19MANIFEST: </trustInfo>20MANIFEST: </assembly>21 22# RUN: lld-link /out:%t.exe /entry:main /manifest \23# RUN: /manifestuac:"level='requireAdministrator' uiAccess='true'" %t.obj24# RUN: FileCheck -check-prefix=UAC %s < %t.exe.manifest25 26UAC: <?xml version="1.0" standalone="yes"?>27UAC: <assembly xmlns="urn:schemas-microsoft-com:asm.v1"28UAC: manifestVersion="1.0">29UAC: <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">30UAC: <security>31UAC: <requestedPrivileges>32UAC: <requestedExecutionLevel level='requireAdministrator' uiAccess='true'/>33UAC: </requestedPrivileges>34UAC: </security>35UAC: </trustInfo>36UAC: </assembly>37 38# /manifestdependency implies /manifest. (/manifestuac doesn't.)39# RUN: lld-link /out:%t.exe /entry:main \40# RUN: /manifestdependency:"foo='bar'" %t.obj41# RUN: FileCheck -check-prefix=DEPENDENCY %s < %t.exe.manifest42 43DEPENDENCY: <?xml version="1.0" standalone="yes"?>44DEPENDENCY: <assembly xmlns="urn:schemas-microsoft-com:asm.v1"45DEPENDENCY: manifestVersion="1.0">46DEPENDENCY: <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">47DEPENDENCY: <security>48DEPENDENCY: <requestedPrivileges>49DEPENDENCY: <requestedExecutionLevel level='asInvoker' uiAccess='false'/>50DEPENDENCY: </requestedPrivileges>51DEPENDENCY: </security>52DEPENDENCY: </trustInfo>53DEPENDENCY: <dependency>54DEPENDENCY: <dependentAssembly>55DEPENDENCY: <assemblyIdentity foo='bar' />56DEPENDENCY: </dependentAssembly>57DEPENDENCY: </dependency>58DEPENDENCY: </assembly>59 60# RUN: lld-link /manifest /out:%t.exe /entry:main /manifestuac:no \61# RUN: /manifestdependency:"foo='bar'" %t.obj62# RUN: FileCheck -check-prefix=NOUAC %s < %t.exe.manifest63 64NOUAC: <?xml version="1.0" standalone="yes"?>65NOUAC: <assembly xmlns="urn:schemas-microsoft-com:asm.v1"66NOUAC: manifestVersion="1.0">67NOUAC: <dependency>68NOUAC: <dependentAssembly>69NOUAC: <assemblyIdentity foo='bar' />70NOUAC: </dependentAssembly>71NOUAC: </dependency>72NOUAC: </assembly>73 74# RUN: lld-link /manifest /out:%t.exe /entry:main /manifestuac:no %t.obj75# RUN: FileCheck -check-prefix=NOUACNODEP %s < %t.exe.manifest76 77NOUACNODEP: <?xml version="1.0" standalone="yes"?>78NOUACNODEP: <assembly xmlns="urn:schemas-microsoft-com:asm.v1"79NOUACNODEP: manifestVersion="1.0">80NOUACNODEP: </assembly>81 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'" \87# RUN: %t.obj88# RUN: FileCheck -check-prefix=SEVERALDEPS %s < %t.exe.manifest89 90SEVERALDEPS: <?xml version="1.0" standalone="yes"?>91SEVERALDEPS: <assembly xmlns="urn:schemas-microsoft-com:asm.v1"92SEVERALDEPS: manifestVersion="1.0">93SEVERALDEPS: <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">94SEVERALDEPS: <security>95SEVERALDEPS: <requestedPrivileges>96SEVERALDEPS: <requestedExecutionLevel level='asInvoker' uiAccess='false'/>97SEVERALDEPS: </requestedPrivileges>98SEVERALDEPS: </security>99SEVERALDEPS: </trustInfo>100SEVERALDEPS: <dependency>101SEVERALDEPS: <dependentAssembly>102SEVERALDEPS: <assemblyIdentity foo='bar' />103SEVERALDEPS: </dependentAssembly>104SEVERALDEPS: <dependency>105SEVERALDEPS: <dependentAssembly>106SEVERALDEPS: <assemblyIdentity baz='quux' />107SEVERALDEPS: </dependentAssembly>108SEVERALDEPS: </dependency>109SEVERALDEPS: </assembly>110 111# /manifestdependency: flags can be in .drectve sections.112# RUN: yaml2obj %p/Inputs/manifestdependency-drectve.yaml -o %t.dir.obj113# RUN: rm %t.exe.manifest114# RUN: lld-link /out:%t.exe /entry:main \115# RUN: %t.obj %t.dir.obj116# RUN: FileCheck -check-prefix=SEVERALDEPS %s < %t.exe.manifest117 118# /manifestdependency: flags in .drectve sections are ignored with an119# explicit /manifest:no.120# RUN: rm %t.exe.manifest121# RUN: lld-link /out:%t.exe /entry:main /manifest:no \122# RUN: %t.obj %t.dir.obj123# RUN: test ! -e %t.exe.manifest124 125# Test that /manifestdependency: flags in .drectve sections work126# with /manifest:embed too.127# RUN: lld-link /out:%t.exe /entry:main /manifest:embed \128# RUN: %t.obj %t.dir.obj129# RUN: test ! -e %t.exe.manifest130# RUN: llvm-readobj --coff-resources %t.exe \131# RUN: | FileCheck --check-prefix EMBED %s132 133EMBED: Data (134EMBED: 0000: 3C3F786D 6C207665 7273696F 6E3D2231 |<?xml version="1|135EMBED: 0010: 2E302220 7374616E 64616C6F 6E653D22 |.0" standalone="|136EMBED: 0020: 79657322 3F3E0A3C 61737365 6D626C79 |yes"?>.<assembly|137EMBED: 0030: 20786D6C 6E733D22 75726E3A 73636865 | xmlns="urn:sche|138EMBED: 0040: 6D61732D 6D696372 6F736F66 742D636F |mas-microsoft-co|139EMBED: 0050: 6D3A6173 6D2E7631 220A2020 20202020 |m:asm.v1". |140EMBED: 0060: 20202020 6D616E69 66657374 56657273 | manifestVers|141EMBED: 0070: 696F6E3D 22312E30 223E0A20 203C7472 |ion="1.0">. <tr|142EMBED: 0080: 75737449 6E666F20 786D6C6E 733D2275 |ustInfo xmlns="u|143EMBED: 0090: 726E3A73 6368656D 61732D6D 6963726F |rn:schemas-micro|144EMBED: 00A0: 736F6674 2D636F6D 3A61736D 2E763322 |soft-com:asm.v3"|145EMBED: 00B0: 3E0A2020 20203C73 65637572 6974793E |>. <security>|146EMBED: 00C0: 0A202020 2020203C 72657175 65737465 |. <requeste|147EMBED: 00D0: 64507269 76696C65 6765733E 0A202020 |dPrivileges>. |148EMBED: 00E0: 20202020 20203C72 65717565 73746564 | <requested|149EMBED: 00F0: 45786563 7574696F 6E4C6576 656C206C |ExecutionLevel l|150EMBED: 0100: 6576656C 3D276173 496E766F 6B657227 |evel='asInvoker'|151EMBED: 0110: 20756941 63636573 733D2766 616C7365 | uiAccess='false|152EMBED: 0120: 272F3E0A 20202020 20203C2F 72657175 |'/>. </requ|153EMBED: 0130: 65737465 64507269 76696C65 6765733E |estedPrivileges>|154EMBED: 0140: 0A202020 203C2F73 65637572 6974793E |. </security>|155EMBED: 0150: 0A20203C 2F747275 7374496E 666F3E0A |. </trustInfo>.|156EMBED: 0160: 20203C64 6570656E 64656E63 793E0A20 | <dependency>. |157EMBED: 0170: 2020203C 64657065 6E64656E 74417373 | <dependentAss|158EMBED: 0180: 656D626C 793E0A20 20202020 203C6173 |embly>. <as|159EMBED: 0190: 73656D62 6C794964 656E7469 74792066 |semblyIdentity f|160EMBED: 01A0: 6F6F3D27 62617227 202F3E0A 20202020 |oo='bar' />. |161EMBED: 01B0: 3C2F6465 70656E64 656E7441 7373656D |</dependentAssem|162EMBED: 01C0: 626C793E 0A20203C 2F646570 656E6465 |bly>. </depende|163EMBED: 01D0: 6E63793E 0A20203C 64657065 6E64656E |ncy>. <dependen|164EMBED: 01E0: 63793E0A 20202020 3C646570 656E6465 |cy>. <depende|165EMBED: 01F0: 6E744173 73656D62 6C793E0A 20202020 |ntAssembly>. |166EMBED: 0200: 20203C61 7373656D 626C7949 64656E74 | <assemblyIdent|167EMBED: 0210: 69747920 62617A3D 27717575 7827202F |ity baz='quux' /|168EMBED: 0220: 3E0A2020 20203C2F 64657065 6E64656E |>. </dependen|169EMBED: 0230: 74417373 656D626C 793E0A20 203C2F64 |tAssembly>. </d|170EMBED: 0240: 6570656E 64656E63 793E0A3C 2F617373 |ependency>.</ass|171EMBED: 0250: 656D626C 793E0A |embly>.|172EMBED: )173