diff options
author | Cyndy Ishida <cyndy_ishida@apple.com> | 2023-09-07 10:26:31 -0700 |
---|---|---|
committer | Cyndy Ishida <cyndy_ishida@apple.com> | 2023-09-07 12:23:12 -0700 |
commit | f9fe6032cd6fd0814a15dfddf3116494ffa46ac7 (patch) | |
tree | ac09be1d5ece9daab62f1504b18bf4e0d94d9dd1 /llvm/unittests/TextAPI | |
parent | e9ed1aa9cd867938cd05fe76df57eb505591e81a (diff) | |
download | llvm-f9fe6032cd6fd0814a15dfddf3116494ffa46ac7.zip llvm-f9fe6032cd6fd0814a15dfddf3116494ffa46ac7.tar.gz llvm-f9fe6032cd6fd0814a15dfddf3116494ffa46ac7.tar.bz2 |
[TextAPI] Support more constructors for PackedVersions
TBD files now record minimum deplyoment versions and tapi interfaces
with apple system linker by a packed version encoding. Support mapping
between that and `VersionTuple`s.
Diffstat (limited to 'llvm/unittests/TextAPI')
-rw-r--r-- | llvm/unittests/TextAPI/TextStubV5Tests.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/unittests/TextAPI/TextStubV5Tests.cpp b/llvm/unittests/TextAPI/TextStubV5Tests.cpp index e6b87fa..54ca21b 100644 --- a/llvm/unittests/TextAPI/TextStubV5Tests.cpp +++ b/llvm/unittests/TextAPI/TextStubV5Tests.cpp @@ -197,8 +197,18 @@ TEST(TBDv5, ReadFile) { Target(AK_arm64, PLATFORM_MACOS, VersionTuple(11, 0, 0)), Target(AK_arm64, PLATFORM_MACCATALYST, VersionTuple(14, 0)), }; + std::set<Target> FileTargets{File->targets().begin(), File->targets().end()}; EXPECT_EQ(mapToPlatformSet(AllTargets), File->getPlatforms()); EXPECT_EQ(mapToArchitectureSet(AllTargets), File->getArchitectures()); + EXPECT_EQ(FileTargets.size(), AllTargets.size()); + for (const auto &Targ : AllTargets) { + auto FileTarg = FileTargets.find(Targ); + EXPECT_FALSE(FileTarg == FileTargets.end()); + EXPECT_EQ(*FileTarg, Targ); + PackedVersion MD = Targ.MinDeployment; + PackedVersion FileMD = FileTarg->MinDeployment; + EXPECT_EQ(MD, FileMD); + } EXPECT_EQ(PackedVersion(1, 2, 0), File->getCurrentVersion()); EXPECT_EQ(PackedVersion(1, 1, 0), File->getCompatibilityVersion()); |