[Test] Fix YAML mapping keys duplication. NFC.
authorAnton Sidorenko <anton.sidorenko@syntacore.com>
Mon, 16 Jan 2023 14:58:28 +0000 (17:58 +0300)
committerAnton Sidorenko <anton.sidorenko@syntacore.com>
Thu, 9 Feb 2023 09:59:50 +0000 (12:59 +0300)
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

bolt/test/AArch64/Inputs/plt-gnu-ld.yaml
llvm/test/CodeGen/AArch64/GlobalISel/select-int-ext.mir
llvm/test/CodeGen/ARM/machine-sink-multidef.mir
llvm/test/CodeGen/PowerPC/jump-tables-collapse-rotate-remove-SrcMI.mir
llvm/test/CodeGen/PowerPC/mi-peephole.mir
llvm/test/CodeGen/X86/fixup-bw-inst.mir
llvm/test/tools/llvm-objcopy/COFF/redefine-symbol.test
llvm/test/tools/llvm-reduce/mir/preserve-func-info.mir
llvm/unittests/TextAPI/TextStubV4Tests.cpp

index 04e7f85..1e3353a 100644 (file)
@@ -175,6 +175,7 @@ Sections:
         Symbol:          .text
         Type:            R_AARCH64_ADD_ABS_LO12_NC
         Addend:          56
+      - Offset:          0x400540
         Symbol:          '__libc_start_main@@GLIBC_2.17'
         Type:            R_AARCH64_CALL26
       - Offset:          0x400544
index 230c1c5..efe15c5 100644 (file)
@@ -128,7 +128,6 @@ body:             |
 ---
 name:            anyext_v2s64_from_v2s32
 alignment:       4
-tracksRegLiveness: true
 legalized:       true
 regBankSelected: true
 tracksRegLiveness: true
index a91cede..737ca82 100644 (file)
@@ -40,7 +40,6 @@ registers:
 liveins:
   - { reg: '$r0', virtual-reg: '%8' }
   - { reg: '$r1', virtual-reg: '%9' }
-liveins:         []
 body:             |
   ; CHECK-LABEL: name: g
   ; CHECK: bb.0:
index 2f7a85a..70b1329 100644 (file)
@@ -32,7 +32,6 @@ frameInfo:
   maxAlignment:    1
 machineFunctionInfo: {}
 body:             |
-body:             |
   bb.0.entry:
     liveins: $x3, $x4
 
index c7f41cd..7bedc05 100644 (file)
@@ -16,7 +16,6 @@ frameInfo:
   maxAlignment:    1
 machineFunctionInfo: {}
 body:             |
-body:             |
   bb.0.entry:
     liveins: $x3, $x4
 
index 301bdb0..c8e7690 100644 (file)
@@ -139,7 +139,8 @@ name:            test5
 alignment:       16
 tracksRegLiveness: true
 liveins:
-  - { reg: '$ch', reg: '$bl' }
+  - { reg: '$ch' }
+  - { reg: '$bl' }
 body:             |
   bb.0:
     liveins: $ch, $bl
index 263d6f3..84511f1 100644 (file)
@@ -39,7 +39,6 @@ sections:
   - Name:            .text
     Characteristics: [ IMAGE_SCN_CNT_CODE, IMAGE_SCN_MEM_EXECUTE, IMAGE_SCN_MEM_READ ]
   - Name:            .rdata
-    Characteristics: [  ]
     Characteristics: [ IMAGE_SCN_CNT_INITIALIZED_DATA, IMAGE_SCN_MEM_READ ]
 symbols:
   - Name:            .text
index 22e41bf..5f11cea 100644 (file)
@@ -45,7 +45,6 @@ failsVerification: true
 tracksDebugUserValues: true
 callsEHReturn: true
 callsUnwindInit: true
-callsUnwindInit: true
 hasEHCatchret: true
 hasEHScopes: true
 hasEHFunclets: true
index f2327ca..570e853 100644 (file)
@@ -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 =