mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-22 18:54:02 +01:00
Add unittests for Triple::getMacOSXVersion and Triple::getiOSVersion.
llvm-svn: 156507
This commit is contained in:
parent
0e378f7bcb
commit
ccf58fa5fd
@ -390,4 +390,69 @@ TEST(TripleTest, BitWidthArchVariants) {
|
|||||||
EXPECT_EQ(Triple::x86_64, T.get64BitArchVariant().getArch());
|
EXPECT_EQ(Triple::x86_64, T.get64BitArchVariant().getArch());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST(TripleTest, getOSVersion) {
|
||||||
|
Triple T;
|
||||||
|
unsigned Major, Minor, Micro;
|
||||||
|
|
||||||
|
T = Triple("i386-apple-darwin9");
|
||||||
|
T.getMacOSXVersion(Major, Minor, Micro);
|
||||||
|
EXPECT_EQ((unsigned)10, Major);
|
||||||
|
EXPECT_EQ((unsigned)5, Minor);
|
||||||
|
EXPECT_EQ((unsigned)0, Micro);
|
||||||
|
T.getiOSVersion(Major, Minor, Micro);
|
||||||
|
EXPECT_EQ((unsigned)3, Major);
|
||||||
|
EXPECT_EQ((unsigned)0, Minor);
|
||||||
|
EXPECT_EQ((unsigned)0, Micro);
|
||||||
|
|
||||||
|
T = Triple("x86_64-apple-darwin9");
|
||||||
|
T.getMacOSXVersion(Major, Minor, Micro);
|
||||||
|
EXPECT_EQ((unsigned)10, Major);
|
||||||
|
EXPECT_EQ((unsigned)5, Minor);
|
||||||
|
EXPECT_EQ((unsigned)0, Micro);
|
||||||
|
T.getiOSVersion(Major, Minor, Micro);
|
||||||
|
EXPECT_EQ((unsigned)3, Major);
|
||||||
|
EXPECT_EQ((unsigned)0, Minor);
|
||||||
|
EXPECT_EQ((unsigned)0, Micro);
|
||||||
|
|
||||||
|
T = Triple("x86_64-apple-macosx");
|
||||||
|
T.getMacOSXVersion(Major, Minor, Micro);
|
||||||
|
EXPECT_EQ((unsigned)10, Major);
|
||||||
|
EXPECT_EQ((unsigned)4, Minor);
|
||||||
|
EXPECT_EQ((unsigned)0, Micro);
|
||||||
|
T.getiOSVersion(Major, Minor, Micro);
|
||||||
|
EXPECT_EQ((unsigned)3, Major);
|
||||||
|
EXPECT_EQ((unsigned)0, Minor);
|
||||||
|
EXPECT_EQ((unsigned)0, Micro);
|
||||||
|
|
||||||
|
T = Triple("x86_64-apple-macosx10.7");
|
||||||
|
T.getMacOSXVersion(Major, Minor, Micro);
|
||||||
|
EXPECT_EQ((unsigned)10, Major);
|
||||||
|
EXPECT_EQ((unsigned)7, Minor);
|
||||||
|
EXPECT_EQ((unsigned)0, Micro);
|
||||||
|
T.getiOSVersion(Major, Minor, Micro);
|
||||||
|
EXPECT_EQ((unsigned)3, Major);
|
||||||
|
EXPECT_EQ((unsigned)0, Minor);
|
||||||
|
EXPECT_EQ((unsigned)0, Micro);
|
||||||
|
|
||||||
|
T = Triple("armv7-apple-ios");
|
||||||
|
T.getMacOSXVersion(Major, Minor, Micro);
|
||||||
|
EXPECT_EQ((unsigned)10, Major);
|
||||||
|
EXPECT_EQ((unsigned)4, Minor);
|
||||||
|
EXPECT_EQ((unsigned)0, Micro);
|
||||||
|
T.getiOSVersion(Major, Minor, Micro);
|
||||||
|
EXPECT_EQ((unsigned)3, Major);
|
||||||
|
EXPECT_EQ((unsigned)0, Minor);
|
||||||
|
EXPECT_EQ((unsigned)0, Micro);
|
||||||
|
|
||||||
|
T = Triple("armv7-apple-ios5.0");
|
||||||
|
T.getMacOSXVersion(Major, Minor, Micro);
|
||||||
|
EXPECT_EQ((unsigned)10, Major);
|
||||||
|
EXPECT_EQ((unsigned)4, Minor);
|
||||||
|
EXPECT_EQ((unsigned)0, Micro);
|
||||||
|
T.getiOSVersion(Major, Minor, Micro);
|
||||||
|
EXPECT_EQ((unsigned)5, Major);
|
||||||
|
EXPECT_EQ((unsigned)0, Minor);
|
||||||
|
EXPECT_EQ((unsigned)0, Micro);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user