aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/TextAPI
diff options
context:
space:
mode:
authorAnton Sidorenko <anton.sidorenko@syntacore.com>2023-01-16 17:58:28 +0300
committerAnton Sidorenko <anton.sidorenko@syntacore.com>2023-02-09 12:59:50 +0300
commit6820cb2dd5cfa103953373b5a00b8e59365bad7f (patch)
treec891c41686945cc0f7d5537ab85d989c03629dbe /llvm/unittests/TextAPI
parent10629bb96aebfefaadfb0069bc7e276b868fcef9 (diff)
downloadllvm-6820cb2dd5cfa103953373b5a00b8e59365bad7f.zip
llvm-6820cb2dd5cfa103953373b5a00b8e59365bad7f.tar.gz
llvm-6820cb2dd5cfa103953373b5a00b8e59365bad7f.tar.bz2
[Test] Fix YAML mapping keys duplication. NFC.
YAML specification does not allow keys duplication an a mapping. However, YAML parser in LLVM does not have any check on that and uses only the last key entry. In this change duplicated keys are merged to satisfy the spec. Differential Revision: https://reviews.llvm.org/D141848
Diffstat (limited to 'llvm/unittests/TextAPI')
-rw-r--r--llvm/unittests/TextAPI/TextStubV4Tests.cpp30
1 files changed, 13 insertions, 17 deletions
diff --git a/llvm/unittests/TextAPI/TextStubV4Tests.cpp b/llvm/unittests/TextAPI/TextStubV4Tests.cpp
index f2327ca..570e853 100644
--- a/llvm/unittests/TextAPI/TextStubV4Tests.cpp
+++ b/llvm/unittests/TextAPI/TextStubV4Tests.cpp
@@ -936,7 +936,8 @@ TEST(TBDv4, InterfaceEquality) {
static const char TBDv4File[] =
"--- !tapi-tbd\n"
"tbd-version: 4\n"
- "targets: [ i386-macos, x86_64-macos, x86_64-ios ]\n"
+ "targets: [ i386-macos, x86_64-macos, x86_64-ios, i386-maccatalyst, "
+ "x86_64-maccatalyst ]\n"
"uuids:\n"
" - target: i386-macos\n"
" value: 00000000-0000-0000-0000-000000000000\n"
@@ -944,6 +945,10 @@ TEST(TBDv4, InterfaceEquality) {
" value: 11111111-1111-1111-1111-111111111111\n"
" - target: x86_64-ios\n"
" value: 11111111-1111-1111-1111-111111111111\n"
+ " - target: i386-maccatalyst\n"
+ " value: 00000000-0000-0000-0000-000000000000\n"
+ " - target: x86_64-maccatalyst\n"
+ " value: 11111111-1111-1111-1111-111111111111\n"
"flags: [ flat_namespace, installapi ]\n"
"install-name: Umbrella.framework/Umbrella\n"
"current-version: 1.2.3\n"
@@ -970,6 +975,13 @@ TEST(TBDv4, InterfaceEquality) {
" symbols: [_symB]\n"
" - targets: [ x86_64-macos, x86_64-ios ]\n"
" symbols: [_symAB]\n"
+ " - targets: [ i386-maccatalyst ]\n"
+ " weak-symbols: [ _symC ]\n"
+ " - targets: [ i386-maccatalyst, x86_64-maccatalyst ]\n"
+ " symbols: [ _symA ]\n"
+ " objc-classes: [ Class1 ]\n"
+ " - targets: [ x86_64-maccatalyst ]\n"
+ " symbols: [ _symAB ]\n"
"reexports:\n"
" - targets: [ i386-macos ]\n"
" symbols: [_symC]\n"
@@ -986,22 +998,6 @@ TEST(TBDv4, InterfaceEquality) {
" objc-ivars: []\n"
" weak-symbols: []\n"
" thread-local-symbols: []\n"
- "tbd-version: 4\n"
- "targets: [ i386-maccatalyst, x86_64-maccatalyst ]\n"
- "uuids:\n"
- " - target: i386-maccatalyst\n"
- " value: 00000000-0000-0000-0000-000000000000\n"
- " - target: x86_64-maccatalyst\n"
- " value: 11111111-1111-1111-1111-111111111111\n"
- "install-name: '/System/Library/Frameworks/A.framework/A'\n"
- "exports:\n"
- " - targets: [ i386-maccatalyst ]\n"
- " weak-symbols: [ _symC ]\n"
- " - targets: [ i386-maccatalyst, x86_64-maccatalyst ]\n"
- " symbols: [ _symA ]\n"
- " objc-classes: [ Class1 ]\n"
- " - targets: [ x86_64-maccatalyst ]\n"
- " symbols: [ _symAB ]\n"
"...\n";
Expected<TBDFile> ResultA =