summaryrefslogtreecommitdiff
path: root/unittests
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2014-03-30 07:19:31 +0000
committerSaleem Abdulrasool <compnerd@compnerd.org>2014-03-30 07:19:31 +0000
commitb52cb5e0db7ed753d8bb43f3c4f3ea068fe1066c (patch)
tree6f079977e48678f0244504a3cab4f324c3005169 /unittests
parenta60d50cb9f0385757327c600efef2dd89797337f (diff)
downloadllvm-b52cb5e0db7ed753d8bb43f3c4f3ea068fe1066c.tar.gz
llvm-b52cb5e0db7ed753d8bb43f3c4f3ea068fe1066c.tar.bz2
llvm-b52cb5e0db7ed753d8bb43f3c4f3ea068fe1066c.tar.xz
Support: correct Windows normalisation
If the environment is unknown and no object file is provided, then assume an "MSVC" environment, otherwise, set the environment to the object file format. In the case that we have a known environment but a non-native file format for Windows (COFF) which is used for MCJIT, then append the custom file format to the triple as an additional component. This fixes the MCJIT tests on Windows. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205130 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests')
-rw-r--r--unittests/ADT/TripleTest.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/unittests/ADT/TripleTest.cpp b/unittests/ADT/TripleTest.cpp
index 52d7de9386..2b806a3163 100644
--- a/unittests/ADT/TripleTest.cpp
+++ b/unittests/ADT/TripleTest.cpp
@@ -513,6 +513,13 @@ TEST(TripleTest, FileFormat) {
EXPECT_EQ(Triple::COFF, Triple("i686--win32").getObjectFormat());
+ EXPECT_EQ(Triple::ELF, Triple("i686-pc-windows-msvc-elf").getObjectFormat());
+
+ {
+ Triple Normalized(Triple::normalize("i686-pc-windows-msvc-elf"));
+ EXPECT_EQ(Triple::ELF, Normalized.getObjectFormat());
+ }
+
Triple T = Triple("");
T.setObjectFormat(Triple::ELF);
EXPECT_EQ(Triple::ELF, T.getObjectFormat());
@@ -546,5 +553,7 @@ TEST(TripleTest, NormalizeWindows) {
EXPECT_EQ("x86_64--windows-macho", Triple::normalize("x86_64-win32-macho"));
EXPECT_EQ("i686-pc-windows-itanium", Triple::normalize("i686-pc-windows-itanium"));
+
+ EXPECT_EQ("i686-pc-windows-msvc", Triple::normalize("i686-pc-windows-msvc"));
}
}