diff options
author | dim <dim@FreeBSD.org> | 2012-08-15 19:34:23 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2012-08-15 19:34:23 +0000 |
commit | 721c201bd55ffb73cb2ba8d39e0570fa38c44e15 (patch) | |
tree | eacfc83d988e4b9d11114387ae7dc41243f2a363 /unittests/ADT/TripleTest.cpp | |
parent | 2b2816e083a455f7a656ae88b0fd059d1688bb36 (diff) | |
download | FreeBSD-src-721c201bd55ffb73cb2ba8d39e0570fa38c44e15.zip FreeBSD-src-721c201bd55ffb73cb2ba8d39e0570fa38c44e15.tar.gz |
Vendor import of llvm trunk r161861:
http://llvm.org/svn/llvm-project/llvm/trunk@161861
Diffstat (limited to 'unittests/ADT/TripleTest.cpp')
-rw-r--r-- | unittests/ADT/TripleTest.cpp | 77 |
1 files changed, 71 insertions, 6 deletions
diff --git a/unittests/ADT/TripleTest.cpp b/unittests/ADT/TripleTest.cpp index 479046e..967437c 100644 --- a/unittests/ADT/TripleTest.cpp +++ b/unittests/ADT/TripleTest.cpp @@ -353,9 +353,9 @@ TEST(TripleTest, BitWidthArchVariants) { EXPECT_EQ(Triple::ppc, T.get32BitArchVariant().getArch()); EXPECT_EQ(Triple::ppc64, T.get64BitArchVariant().getArch()); - T.setArch(Triple::ptx32); - EXPECT_EQ(Triple::ptx32, T.get32BitArchVariant().getArch()); - EXPECT_EQ(Triple::ptx64, T.get64BitArchVariant().getArch()); + T.setArch(Triple::nvptx); + EXPECT_EQ(Triple::nvptx, T.get32BitArchVariant().getArch()); + EXPECT_EQ(Triple::nvptx64, T.get64BitArchVariant().getArch()); T.setArch(Triple::sparc); EXPECT_EQ(Triple::sparc, T.get32BitArchVariant().getArch()); @@ -377,9 +377,9 @@ TEST(TripleTest, BitWidthArchVariants) { EXPECT_EQ(Triple::ppc, T.get32BitArchVariant().getArch()); EXPECT_EQ(Triple::ppc64, T.get64BitArchVariant().getArch()); - T.setArch(Triple::ptx64); - EXPECT_EQ(Triple::ptx32, T.get32BitArchVariant().getArch()); - EXPECT_EQ(Triple::ptx64, T.get64BitArchVariant().getArch()); + T.setArch(Triple::nvptx64); + EXPECT_EQ(Triple::nvptx, T.get32BitArchVariant().getArch()); + EXPECT_EQ(Triple::nvptx64, T.get64BitArchVariant().getArch()); T.setArch(Triple::sparcv9); EXPECT_EQ(Triple::sparc, T.get32BitArchVariant().getArch()); @@ -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); +} + } |