ARMv7k: use Cortex-A7 by default even for tvOS
authorTim Northover <tnorthover@apple.com>
Thu, 11 Feb 2016 23:49:08 +0000 (23:49 +0000)
committerTim Northover <tnorthover@apple.com>
Thu, 11 Feb 2016 23:49:08 +0000 (23:49 +0000)
Also actually test the default CPU from those triples.

llvm-svn: 260621

llvm/lib/Support/Triple.cpp
llvm/unittests/ADT/TripleTest.cpp

index 1485d8e..12aa7bf 100644 (file)
@@ -1412,6 +1412,7 @@ StringRef Triple::getARMCPUForArch(StringRef MArch) const {
   case llvm::Triple::MacOSX:
   case llvm::Triple::IOS:
   case llvm::Triple::WatchOS:
+  case llvm::Triple::TvOS:
     if (MArch == "v7k")
       return "cortex-a7";
     break;
index ad143ff..7712b5a 100644 (file)
@@ -983,6 +983,18 @@ TEST(TripleTest, getARMCPUForArch) {
     EXPECT_EQ("swift", Triple.getARMCPUForArch());
   }
   {
+    llvm::Triple Triple("armv7k-apple-ios9");
+    EXPECT_EQ("cortex-a7", Triple.getARMCPUForArch());
+  }
+  {
+    llvm::Triple Triple("armv7k-apple-watchos3");
+    EXPECT_EQ("cortex-a7", Triple.getARMCPUForArch());
+  }
+  {
+    llvm::Triple Triple("armv7k-apple-tvos9");
+    EXPECT_EQ("cortex-a7", Triple.getARMCPUForArch());
+  }
+  {
     llvm::Triple Triple("armv7em-apple-ios7");
     EXPECT_EQ("cortex-m4", Triple.getARMCPUForArch());
   }