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
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 0000000..b16cc87
--- /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>