From afb45f94ea5ad1690e0fbe8858ff9597dd8aa80c Mon Sep 17 00:00:00 2001 From: Paul Robinson Date: Thu, 4 Feb 2021 09:43:03 -0800 Subject: [PATCH] [PS4] Allow triple to reflect the new company name. --- lib/Support/Triple.cpp | 1 + unittests/ADT/TripleTest.cpp | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/lib/Support/Triple.cpp b/lib/Support/Triple.cpp index 4f483c96528..40c4f3db8b5 100644 --- a/lib/Support/Triple.cpp +++ b/lib/Support/Triple.cpp @@ -479,6 +479,7 @@ static Triple::VendorType parseVendor(StringRef VendorName) { .Case("apple", Triple::Apple) .Case("pc", Triple::PC) .Case("scei", Triple::SCEI) + .Case("sie", Triple::SCEI) .Case("fsl", Triple::Freescale) .Case("ibm", Triple::IBM) .Case("img", Triple::ImaginationTechnologies) diff --git a/unittests/ADT/TripleTest.cpp b/unittests/ADT/TripleTest.cpp index ff6c2dde4b1..0e49a1aa143 100644 --- a/unittests/ADT/TripleTest.cpp +++ b/unittests/ADT/TripleTest.cpp @@ -111,6 +111,17 @@ TEST(TripleTest, ParsedIDs) { EXPECT_EQ(Triple::Linux, T.getOS()); EXPECT_EQ(Triple::Musl, T.getEnvironment()); + // PS4 has two spellings for the vendor. + T = Triple("x86_64-scei-ps4"); + EXPECT_EQ(Triple::x86_64, T.getArch()); + EXPECT_EQ(Triple::SCEI, T.getVendor()); + EXPECT_EQ(Triple::PS4, T.getOS()); + + T = Triple("x86_64-sie-ps4"); + EXPECT_EQ(Triple::x86_64, T.getArch()); + EXPECT_EQ(Triple::SCEI, T.getVendor()); + EXPECT_EQ(Triple::PS4, T.getOS()); + T = Triple("powerpc-ibm-aix"); EXPECT_EQ(Triple::ppc, T.getArch()); EXPECT_EQ(Triple::IBM, T.getVendor());