ARMv7k: use Cortex-A7 by default even for tvOS

Also actually test the default CPU from those triples.

llvm-svn: 260621
This commit is contained in:
Tim Northover 2016-02-11 23:49:08 +00:00
parent 9e7cb55466
commit 49f7c6fb6b
2 changed files with 13 additions and 0 deletions

View 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;

View File

@ -982,6 +982,18 @@ TEST(TripleTest, getARMCPUForArch) {
llvm::Triple Triple("armv7s-apple-ios7");
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());