summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorEric Beckmann <ecbeckmann@google.com>2017-08-19 00:37:41 +0000
committerEric Beckmann <ecbeckmann@google.com>2017-08-19 00:37:41 +0000
commit91d8af53863aec05c28b38b81c69492d6276e98e (patch)
treee5ee91a83302bd2ee8c23a5a27aa270041178ea8 /llvm/test
parent42479e02caccc8716418a10955371363105d1bf6 (diff)
downloadbcm5719-llvm-91d8af53863aec05c28b38b81c69492d6276e98e.tar.gz
bcm5719-llvm-91d8af53863aec05c28b38b81c69492d6276e98e.zip
llvm-mt: Merge manifest namespaces.
mt.exe performs a tree merge where certain element nodes are combined into one. This introduces the possibility of xml namespaces conflicting with each other. The original mt.exe has a hierarchy whereby certain namespace names can override others, and nodes that would then end up in ambigious namespaces have their namespaces explicitly defined. This namespace handles this merging process. llvm-svn: 311215
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/tools/llvm-mt/Inputs/assembly_identity.manifest8
-rw-r--r--llvm/test/tools/llvm-mt/Inputs/compatibility.manifest9
-rw-r--r--llvm/test/tools/llvm-mt/Inputs/expected_big.manifest29
-rw-r--r--llvm/test/tools/llvm-mt/Inputs/trust_and_identity.manifest20
-rw-r--r--llvm/test/tools/llvm-mt/Inputs/trust_info.manifest9
-rw-r--r--llvm/test/tools/llvm-mt/Inputs/windows_settings.manifest8
-rw-r--r--llvm/test/tools/llvm-mt/big_merge.test39
-rw-r--r--llvm/test/tools/llvm-mt/help.test4
-rw-r--r--llvm/test/tools/llvm-mt/simple_merge.test2
-rw-r--r--llvm/test/tools/llvm-mt/single_file.test2
-rw-r--r--llvm/test/tools/llvm-mt/xml_error.test6
11 files changed, 131 insertions, 5 deletions
diff --git a/llvm/test/tools/llvm-mt/Inputs/assembly_identity.manifest b/llvm/test/tools/llvm-mt/Inputs/assembly_identity.manifest
new file mode 100644
index 00000000000..2090be18400
--- /dev/null
+++ b/llvm/test/tools/llvm-mt/Inputs/assembly_identity.manifest
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<assembly xmlns="urn:schemas-microsoft-com:asm.v2" manifestVersion="1.0">
+ <dependency>
+ <dependentAssembly>
+ <assemblyIdentity foo="bar" name="identity1" version="1.2.3.4"></assemblyIdentity>
+ </dependentAssembly>
+ </dependency>
+</assembly>
diff --git a/llvm/test/tools/llvm-mt/Inputs/compatibility.manifest b/llvm/test/tools/llvm-mt/Inputs/compatibility.manifest
new file mode 100644
index 00000000000..4a5d3bd85b5
--- /dev/null
+++ b/llvm/test/tools/llvm-mt/Inputs/compatibility.manifest
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
+ <application>
+ <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
+ <supportedOS Id="FooOS"/>
+ <supportedOS Id="BarOS"/>
+ </compatibility>
+ </application>
+</assembly>
diff --git a/llvm/test/tools/llvm-mt/Inputs/expected_big.manifest b/llvm/test/tools/llvm-mt/Inputs/expected_big.manifest
new file mode 100644
index 00000000000..1d88447ada3
--- /dev/null
+++ b/llvm/test/tools/llvm-mt/Inputs/expected_big.manifest
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
+<ms_asmv1:trustInfo xmlns="urn:schemas-microsoft-com:asm.v3" xmlns:ms_asmv1="urn:schemas-microsoft-com:asm.v1">
+ <ms_asmv1:security>
+ <ms_asmv1:requestedPrivileges>
+ <ms_asmv1:requestedExecutionLevel level="trust1" ms_asmv1:access="false"></ms_asmv1:requestedExecutionLevel>
+ </ms_asmv1:requestedPrivileges>
+ </ms_asmv1:security>
+</ms_asmv1:trustInfo>
+<ms_asmv2:dependency xmlns:ms_asmv2="urn:schemas-microsoft-com:asm.v2">
+ <ms_asmv2:dependentAssembly>
+ <ms_asmv2:assemblyIdentity foo="bar" name="identity1" version="1.2.3.4"></assemblyIdentity>
+ </ms_asmv2:dependentAssembly>
+</ms_asmv2:dependency>
+<dependency>
+ <dependentAssembly>
+ <assemblyIdentity bar="foo" name="my assembly" version="5"></assemblyIdentity>
+ </dependentAssembly>
+</dependency>
+<application xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
+ <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
+ <supportedOS Id="FooOS"/>
+ <supportedOS Id="BarOS"/>
+ </compatibility>
+ <asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
+ <dpiAware>true/pm</dpiAware>
+ </asmv3:windowsSettings>
+</application>
+</assembly>
diff --git a/llvm/test/tools/llvm-mt/Inputs/trust_and_identity.manifest b/llvm/test/tools/llvm-mt/Inputs/trust_and_identity.manifest
new file mode 100644
index 00000000000..40c1b141405
--- /dev/null
+++ b/llvm/test/tools/llvm-mt/Inputs/trust_and_identity.manifest
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
+
+ <!--random comment -->
+
+ <dependency>
+ <dependentAssembly>
+ <assemblyIdentity bar="foo" name="my assembly" version="5"></assemblyIdentity>
+ </dependentAssembly>
+ </dependency>
+
+ <trustInfo>
+ <security>
+ <requestedPrivileges>
+ <requestedExecutionLevel level="trust1" access="false"/>
+ </requestedPrivileges>
+ </security>
+ </trustInfo>
+
+</assembly>
diff --git a/llvm/test/tools/llvm-mt/Inputs/trust_info.manifest b/llvm/test/tools/llvm-mt/Inputs/trust_info.manifest
new file mode 100644
index 00000000000..114a118e302
--- /dev/null
+++ b/llvm/test/tools/llvm-mt/Inputs/trust_info.manifest
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
+<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
+ <security>
+ <requestedPrivileges>
+ <requestedExecutionLevel level="trust1"></requestedExecutionLevel>
+ </requestedPrivileges>
+ </security>
+</trustInfo></assembly>
diff --git a/llvm/test/tools/llvm-mt/Inputs/windows_settings.manifest b/llvm/test/tools/llvm-mt/Inputs/windows_settings.manifest
new file mode 100644
index 00000000000..20e4adca10c
--- /dev/null
+++ b/llvm/test/tools/llvm-mt/Inputs/windows_settings.manifest
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<assembly xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings" manifestVersion="1.0">
+ <asmv3:application xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
+ <asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
+ <dpiAware>true/pm</dpiAware>
+ </asmv3:windowsSettings>
+ </asmv3:application>
+</assembly>
diff --git a/llvm/test/tools/llvm-mt/big_merge.test b/llvm/test/tools/llvm-mt/big_merge.test
new file mode 100644
index 00000000000..b16cc87926a
--- /dev/null
+++ b/llvm/test/tools/llvm-mt/big_merge.test
@@ -0,0 +1,39 @@
+REQUIRES: libxml2
+UNSUPPORTED: windows
+
+RUN: llvm-mt /manifest %p/Inputs/trust_info.manifest \
+RUN: /manifest %p/Inputs/assembly_identity.manifest \
+RUN: /manifest %p/Inputs/trust_and_identity.manifest \
+RUN: /manifest %p/Inputs/compatibility.manifest \
+RUN: /manifest %p/Inputs/windows_settings.manifest /out:%t
+RUN: FileCheck %s -input-file=%t
+
+CHECK: <?xml version="1.0" encoding="UTF-8"?>
+CHECK-NEXT: <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
+CHECK-NEXT: <ms_asmv1:trustInfo xmlns="urn:schemas-microsoft-com:asm.v3" xmlns:ms_asmv1="urn:schemas-microsoft-com:asm.v1">
+CHECK-NEXT: <ms_asmv1:security>
+CHECK-NEXT: <ms_asmv1:requestedPrivileges>
+CHECK-NEXT: <ms_asmv1:requestedExecutionLevel level="trust1" ms_asmv1:access="false"/>
+CHECK-NEXT: </ms_asmv1:requestedPrivileges>
+CHECK-NEXT: </ms_asmv1:security>
+CHECK-NEXT: </ms_asmv1:trustInfo>
+CHECK-NEXT: <ms_asmv2:dependency xmlns:ms_asmv2="urn:schemas-microsoft-com:asm.v2">
+CHECK-NEXT: <ms_asmv2:dependentAssembly>
+CHECK-NEXT: <ms_asmv2:assemblyIdentity foo="bar" name="identity1" version="1.2.3.4"/>
+CHECK-NEXT: </ms_asmv2:dependentAssembly>
+CHECK-NEXT: </ms_asmv2:dependency>
+CHECK-NEXT: <dependency>
+CHECK-NEXT: <dependentAssembly>
+CHECK-NEXT: <assemblyIdentity bar="foo" name="my assembly" version="5"/>
+CHECK-NEXT: </dependentAssembly>
+CHECK-NEXT: </dependency>
+CHECK-NEXT: <application xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
+CHECK-NEXT: <compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
+CHECK-NEXT: <supportedOS Id="FooOS"/>
+CHECK-NEXT: <supportedOS Id="BarOS"/>
+CHECK-NEXT: </compatibility>
+CHECK-NEXT: <asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
+CHECK-NEXT: <dpiAware>true/pm</dpiAware>
+CHECK-NEXT: </asmv3:windowsSettings>
+CHECK-NEXT: </application>
+CHECK-NEXT: </assembly>
diff --git a/llvm/test/tools/llvm-mt/help.test b/llvm/test/tools/llvm-mt/help.test
index 190e90a1fdc..c42273a5c34 100644
--- a/llvm/test/tools/llvm-mt/help.test
+++ b/llvm/test/tools/llvm-mt/help.test
@@ -1,3 +1,7 @@
RUN: llvm-mt /h | FileCheck %s -check-prefix=HELP
HELP: OVERVIEW: Manifest Tool
+
+RUN: not llvm-mt /foo 2>&1 >/dev/null | FileCheck %s -check-prefix=INVALID
+
+INVALID: llvm-mt error: invalid option /foo
diff --git a/llvm/test/tools/llvm-mt/simple_merge.test b/llvm/test/tools/llvm-mt/simple_merge.test
index 13b78088ddf..3748ae732cd 100644
--- a/llvm/test/tools/llvm-mt/simple_merge.test
+++ b/llvm/test/tools/llvm-mt/simple_merge.test
@@ -5,7 +5,7 @@ RUN: llvm-mt /manifest %p/Inputs/test_manifest.manifest /manifest \
RUN: %p/Inputs/additional.manifest /out:%t
RUN: FileCheck %s -input-file=%t
-CHECK: <?xml version="1.0"?>
+CHECK: <?xml version="1.0" encoding="UTF-8"?>
CHECK-NEXT: <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
CHECK-NEXT: <trustInfo>
CHECK-NEXT: <security>
diff --git a/llvm/test/tools/llvm-mt/single_file.test b/llvm/test/tools/llvm-mt/single_file.test
index 9db22c332ba..6b1429b5581 100644
--- a/llvm/test/tools/llvm-mt/single_file.test
+++ b/llvm/test/tools/llvm-mt/single_file.test
@@ -4,7 +4,7 @@ UNSUPPORTED: windows
RUN: llvm-mt /manifest %p/Inputs/test_manifest.manifest /out:%t
RUN: FileCheck %s --input-file=%t
-CHECK: <?xml version="1.0"?>
+CHECK: <?xml version="1.0" encoding="UTF-8"?>
CHECK-NEXT: <assembly xmlns="urn:schemas-microsoft-com:asm.v1">
CHECK-NEXT: <trustInfo>
CHECK-NEXT: <security>
diff --git a/llvm/test/tools/llvm-mt/xml_error.test b/llvm/test/tools/llvm-mt/xml_error.test
index 762a6640254..40537cd05e9 100644
--- a/llvm/test/tools/llvm-mt/xml_error.test
+++ b/llvm/test/tools/llvm-mt/xml_error.test
@@ -11,8 +11,8 @@ RUN: FileCheck %s -check-prefix=EMPTY
EMPTY: llvm-mt error: attempted to merge empty manifest
-RUN: llvm-mt /inputresource:foo.res /manifest \
-RUN: %p/Inputs/test_manifest.manifest | FileCheck %s \
-RUN: -check-prefix=NOT_SUPPORTED
+RUN: llvm-mt /inputresource:foo.res \
+RUN: /manifest %p/Inputs/test_manifest.manifest \
+RUN: /out:%t | FileCheck %s -check-prefix=NOT_SUPPORTED
NOT_SUPPORTED: llvm-mt: ignoring unsupported 'inputresource:' option
OpenPOWER on IntegriCloud