[PATCH] D75688: [TextAPI] Teach TextAPI about arm64e
Cyndy Ishida via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 5 13:45:13 PST 2020
This revision was automatically updated to reflect the committed changes.
Closed by commit rGa0cd41342647: [TextAPI] Teach TextAPI about arm64e (authored by cishida).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D75688/new/
https://reviews.llvm.org/D75688
Files:
llvm/include/llvm/TextAPI/MachO/Architecture.def
llvm/unittests/TextAPI/TextStubV3Tests.cpp
llvm/unittests/TextAPI/TextStubV4Tests.cpp
Index: llvm/unittests/TextAPI/TextStubV4Tests.cpp
===================================================================
--- llvm/unittests/TextAPI/TextStubV4Tests.cpp
+++ llvm/unittests/TextAPI/TextStubV4Tests.cpp
@@ -375,6 +375,28 @@
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"
Index: llvm/unittests/TextAPI/TextStubV3Tests.cpp
===================================================================
--- llvm/unittests/TextAPI/TextStubV3Tests.cpp
+++ llvm/unittests/TextAPI/TextStubV3Tests.cpp
@@ -408,6 +408,31 @@
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"
Index: llvm/include/llvm/TextAPI/MachO/Architecture.def
===================================================================
--- llvm/include/llvm/TextAPI/MachO/Architecture.def
+++ llvm/include/llvm/TextAPI/MachO/Architecture.def
@@ -36,3 +36,4 @@
/// 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)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D75688.248599.patch
Type: text/x-patch
Size: 3270 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200305/1fd52118/attachment.bin>
More information about the llvm-commits
mailing list