mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-30 04:35:00 +00:00
Add unittests for Triple::getMacOSXVersion and Triple::getiOSVersion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156507 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
fd39afb5e1
commit
9166d23327
@ -390,4 +390,69 @@ TEST(TripleTest, BitWidthArchVariants) {
|
||||
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…
x
Reference in New Issue
Block a user