1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 20:23:11 +01:00

[TextAPI] Teach TextAPI about arm64e

Reviewers: ributzka, cishida

Subscribers: kristof.beyls, dexonsmith, dcoughlin, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D75688
This commit is contained in:
Cyndy Ishida 2020-03-05 10:04:32 -08:00
parent 39b859fb9b
commit 25e7b20da0
3 changed files with 48 additions and 0 deletions

View File

@ -36,3 +36,4 @@ ARCHINFO(armv7em, MachO::CPU_TYPE_ARM, MachO::CPU_SUBTYPE_ARM_V7EM)
/// ARM64 architectures sorted by cpu sub type id.
///
ARCHINFO(arm64, MachO::CPU_TYPE_ARM64, MachO::CPU_SUBTYPE_ARM64_ALL)
ARCHINFO(arm64e, MachO::CPU_TYPE_ARM64, MachO::CPU_SUBTYPE_ARM64E)

View File

@ -408,6 +408,31 @@ TEST(TBDv3, Platform_tvOSSim) {
stripWhitespace(Buffer.c_str()));
}
TEST(TBDv3, Arch_arm64e) {
static const char TBDv3ArchArm64e[] = "--- !tapi-tbd-v3\n"
"archs: [ arm64, arm64e ]\n"
"platform: ios\n"
"install-name: Test.dylib\n"
"...\n";
auto Result =
TextAPIReader::get(MemoryBufferRef(TBDv3ArchArm64e, "Test.tbd"));
EXPECT_TRUE(!!Result);
auto File = std::move(Result.get());
auto Platform = PlatformKind::iOS;
auto Archs = AK_arm64 | AK_arm64e;
EXPECT_EQ(FileType::TBD_V3, File->getFileType());
EXPECT_EQ(File->getPlatforms().size(), 1U);
EXPECT_EQ(Platform, *File->getPlatforms().begin());
EXPECT_EQ(Archs, File->getArchitectures());
SmallString<4096> Buffer;
raw_svector_ostream OS(Buffer);
auto WriteResult = TextAPIWriter::writeToStream(OS, *File);
EXPECT_TRUE(!WriteResult);
EXPECT_EQ(stripWhitespace(TBDv3ArchArm64e), stripWhitespace(Buffer.c_str()));
}
TEST(TBDv3, Swift_1_0) {
static const char TBDv3Swift1[] = "--- !tapi-tbd-v3\n"
"archs: [ arm64 ]\n"

View File

@ -375,6 +375,28 @@ TEST(TBDv4, Target_arm_bridgeOS) {
stripWhitespace(Buffer.c_str()));
}
TEST(TBDv4, Target_arm_iOS) {
static const char tbdv4_arm64e[] = "--- !tapi-tbd\n"
"tbd-version: 4\n"
"targets: [ arm64e-ios ]\n"
"install-name: Test.dylib\n"
"...\n";
auto Result = TextAPIReader::get(MemoryBufferRef(tbdv4_arm64e, "Test.tbd"));
EXPECT_TRUE(!!Result);
auto File = std::move(Result.get());
EXPECT_EQ(FileType::TBD_V4, File->getFileType());
EXPECT_EQ(File->getPlatforms().size(), 1U);
EXPECT_EQ(PlatformKind::iOS, *File->getPlatforms().begin());
EXPECT_EQ(ArchitectureSet(AK_arm64e), File->getArchitectures());
SmallString<4096> Buffer;
raw_svector_ostream OS(Buffer);
auto WriteResult = TextAPIWriter::writeToStream(OS, *File);
EXPECT_TRUE(!WriteResult);
EXPECT_EQ(stripWhitespace(tbdv4_arm64e), stripWhitespace(Buffer.c_str()));
}
TEST(TBDv4, Target_x86_macos) {
static const char tbd_x86_macos[] = "--- !tapi-tbd\n"
"tbd-version: 4\n"