summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/TextAPI/TextStubV3Tests.cpp
diff options
context:
space:
mode:
authorCyndy Ishida <cyndy_ishida@apple.com>2019-09-23 15:28:02 +0000
committerCyndy Ishida <cyndy_ishida@apple.com>2019-09-23 15:28:02 +0000
commitd8d99d957c1624ac812d2586a22fdc72f79b758e (patch)
treeed9ec05825ed6916177f12b8c18c32ed79c2f7f4 /llvm/unittests/TextAPI/TextStubV3Tests.cpp
parentb70323e5d35171ae32ea10ff49e86cdb4b118c30 (diff)
downloadbcm5719-llvm-d8d99d957c1624ac812d2586a22fdc72f79b758e.tar.gz
bcm5719-llvm-d8d99d957c1624ac812d2586a22fdc72f79b758e.zip
[TextAPI] Add New Supported Platforms
Summary: This patch introduces simulators, as well was the restriced zippered and macCatalyst to supported platforms Reviewers: ributzka, steven_wu Reviewed By: ributzka Subscribers: hiraditya, dexonsmith, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D67528 llvm-svn: 372618
Diffstat (limited to 'llvm/unittests/TextAPI/TextStubV3Tests.cpp')
-rw-r--r--llvm/unittests/TextAPI/TextStubV3Tests.cpp37
1 files changed, 37 insertions, 0 deletions
diff --git a/llvm/unittests/TextAPI/TextStubV3Tests.cpp b/llvm/unittests/TextAPI/TextStubV3Tests.cpp
index 10d76b5b8fe..c8b16dbb7d7 100644
--- a/llvm/unittests/TextAPI/TextStubV3Tests.cpp
+++ b/llvm/unittests/TextAPI/TextStubV3Tests.cpp
@@ -274,6 +274,43 @@ TEST(TBDv3, Platform_bridgeOS) {
EXPECT_EQ(Platform, *File->getPlatforms().begin());
}
+TEST(TBDv3, Platform_macCatalyst) {
+ static const char tbd_v1_platform_iosmac[] = "--- !tapi-tbd-v3\n"
+ "archs: [ armv7k ]\n"
+ "platform: iosmac\n"
+ "install-name: Test.dylib\n"
+ "...\n";
+
+ auto Result =
+ TextAPIReader::get(MemoryBufferRef(tbd_v1_platform_iosmac, "Test.tbd"));
+ EXPECT_TRUE(!!Result);
+ auto Platform = PlatformKind::macCatalyst;
+ auto File = std::move(Result.get());
+ EXPECT_EQ(FileType::TBD_V3, File->getFileType());
+ EXPECT_EQ(Platform, *File->getPlatforms().begin());
+}
+
+TEST(TBDv3, Platform_zippered) {
+ static const char tbd_v1_platform_zip[] = "--- !tapi-tbd-v3\n"
+ "archs: [ armv7k ]\n"
+ "platform: zippered\n"
+ "install-name: Test.dylib\n"
+ "...\n";
+
+ auto Result =
+ TextAPIReader::get(MemoryBufferRef(tbd_v1_platform_zip, "Test.tbd"));
+ EXPECT_TRUE(!!Result);
+ auto File = std::move(Result.get());
+ EXPECT_EQ(FileType::TBD_V3, File->getFileType());
+
+ PlatformSet Platforms;
+ Platforms.insert(PlatformKind::macOS);
+ Platforms.insert(PlatformKind::macCatalyst);
+ EXPECT_EQ(Platforms.size(), File->getPlatforms().size());
+ for (auto Platform : File->getPlatforms())
+ EXPECT_EQ(Platforms.count(Platform), 1U);
+}
+
TEST(TBDv3, Swift_1_0) {
static const char tbd_v1_swift_1_0[] = "--- !tapi-tbd-v3\n"
"archs: [ arm64 ]\n"
OpenPOWER on IntegriCloud