summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/ADT/TripleTest.cpp
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
commitf80b49b5d2ca5a7338c19a02a357dd1824d89740 (patch)
treecff3a0a9ccf9f31d1e872fdd20b84f11a5ba46a8 /llvm/unittests/ADT/TripleTest.cpp
parentee4f4025c3e770d6b5f0cbca5b92f43d88056323 (diff)
downloadbcm5719-llvm-f80b49b5d2ca5a7338c19a02a357dd1824d89740.tar.gz
bcm5719-llvm-f80b49b5d2ca5a7338c19a02a357dd1824d89740.zip
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. llvm-svn: 205130
Diffstat (limited to 'llvm/unittests/ADT/TripleTest.cpp')
-rw-r--r--llvm/unittests/ADT/TripleTest.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/unittests/ADT/TripleTest.cpp b/llvm/unittests/ADT/TripleTest.cpp
index 52d7de9386b..2b806a3163d 100644
--- a/llvm/unittests/ADT/TripleTest.cpp
+++ b/llvm/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"));
}
}
OpenPOWER on IntegriCloud