[llvm] 6e779e9 - [ObjectYAML] - Redefine LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::yaml::Hex*) as LLVM_YAML_IS_FLOW_SEQUENCE_VECTOR.
Georgii Rymar via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 30 08:18:17 PDT 2019
Author: Georgii Rymar
Date: 2019-10-30T18:12:48+03:00
New Revision: 6e779e953e9d526e215e64bd1c8ebba8db0b44fe
URL: https://github.com/llvm/llvm-project/commit/6e779e953e9d526e215e64bd1c8ebba8db0b44fe
DIFF: https://github.com/llvm/llvm-project/commit/6e779e953e9d526e215e64bd1c8ebba8db0b44fe.diff
LOG: [ObjectYAML] - Redefine LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::yaml::Hex*) as LLVM_YAML_IS_FLOW_SEQUENCE_VECTOR.
I am using it in https://reviews.llvm.org/D69399.
This change changes how obj2yaml dumps arrays of `llvm::yaml::Hex8/llvm::yaml::Hex16/llvm::yaml::Hex32`
from:
```
PayloadBytes:
- 0x01
- 0x02
...
```
To
```
PayloadBytes: [ 0x01, 0x02, ... ]
```
The latter way is shorter and looks better for arrays.
Differential revision: https://reviews.llvm.org/D69558
Added:
Modified:
llvm/include/llvm/ObjectYAML/DWARFYAML.h
llvm/include/llvm/Support/YAMLTraits.h
llvm/test/ObjectYAML/MachO/DWARF-debug_info.yaml
llvm/test/ObjectYAML/MachO/DWARF2-AddrSize8-FormValues.yaml
llvm/test/ObjectYAML/MachO/DWARF5-debug_info.yaml
llvm/test/ObjectYAML/MachO/bind_opcode.yaml
llvm/test/ObjectYAML/MachO/bogus_load_command.yaml
llvm/test/ObjectYAML/MachO/lazy_bind_opcode.yaml
llvm/test/ObjectYAML/MachO/out_of_order_linkedit.yaml
llvm/test/ObjectYAML/MachO/rebase_opcode.yaml
llvm/test/ObjectYAML/MachO/weak_bind_opcode.yaml
llvm/unittests/Support/YAMLIOTest.cpp
Removed:
################################################################################
diff --git a/llvm/include/llvm/ObjectYAML/DWARFYAML.h b/llvm/include/llvm/ObjectYAML/DWARFYAML.h
index 525fd9a89242..26dabfcf27fe 100644
--- a/llvm/include/llvm/ObjectYAML/DWARFYAML.h
+++ b/llvm/include/llvm/ObjectYAML/DWARFYAML.h
@@ -161,8 +161,6 @@ struct Data {
} // end namespace DWARFYAML
} // end namespace llvm
-LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::yaml::Hex64)
-LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::yaml::Hex8)
LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::DWARFYAML::AttributeAbbrev)
LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::DWARFYAML::Abbrev)
LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::DWARFYAML::ARangeDescriptor)
diff --git a/llvm/include/llvm/Support/YAMLTraits.h b/llvm/include/llvm/Support/YAMLTraits.h
index a3bfa7dc4678..f365d60b3ffa 100644
--- a/llvm/include/llvm/Support/YAMLTraits.h
+++ b/llvm/include/llvm/Support/YAMLTraits.h
@@ -2035,4 +2035,9 @@ template <typename T> struct StdMapStringCustomMappingTraitsImpl {
} \
}
+LLVM_YAML_IS_FLOW_SEQUENCE_VECTOR(llvm::yaml::Hex64)
+LLVM_YAML_IS_FLOW_SEQUENCE_VECTOR(llvm::yaml::Hex32)
+LLVM_YAML_IS_FLOW_SEQUENCE_VECTOR(llvm::yaml::Hex16)
+LLVM_YAML_IS_FLOW_SEQUENCE_VECTOR(llvm::yaml::Hex8)
+
#endif // LLVM_SUPPORT_YAMLTRAITS_H
diff --git a/llvm/test/ObjectYAML/MachO/DWARF-debug_info.yaml b/llvm/test/ObjectYAML/MachO/DWARF-debug_info.yaml
index 0ede72bd1f41..3b311cf1681e 100644
--- a/llvm/test/ObjectYAML/MachO/DWARF-debug_info.yaml
+++ b/llvm/test/ObjectYAML/MachO/DWARF-debug_info.yaml
@@ -531,8 +531,7 @@ DWARF:
#CHECK: - Value: 0x0000000100000F50
#CHECK: - Value: 0x0000000000000034
#CHECK: - Value: 0x0000000000000001
-#CHECK: BlockData:
-#CHECK: - 0x56
+#CHECK: BlockData: [ 0x56 ]
#CHECK: - Value: 0x0000000000000076
#CHECK: - Value: 0x0000000000000001
#CHECK: - Value: 0x0000000000000003
@@ -542,9 +541,7 @@ DWARF:
#CHECK: - AbbrCode: 0x00000003
#CHECK: Values:
#CHECK: - Value: 0x0000000000000002
-#CHECK: BlockData:
-#CHECK: - 0x91
-#CHECK: - 0x78
+#CHECK: BlockData: [ 0x91, 0x78 ]
#CHECK: - Value: 0x000000000000007B
#CHECK: - Value: 0x0000000000000001
#CHECK: - Value: 0x0000000000000003
@@ -552,9 +549,7 @@ DWARF:
#CHECK: - AbbrCode: 0x00000003
#CHECK: Values:
#CHECK: - Value: 0x0000000000000002
-#CHECK: BlockData:
-#CHECK: - 0x91
-#CHECK: - 0x70
+#CHECK: BlockData: [ 0x91, 0x70 ]
#CHECK: - Value: 0x0000000000000080
#CHECK: - Value: 0x0000000000000001
#CHECK: - Value: 0x0000000000000003
diff --git a/llvm/test/ObjectYAML/MachO/DWARF2-AddrSize8-FormValues.yaml b/llvm/test/ObjectYAML/MachO/DWARF2-AddrSize8-FormValues.yaml
index e91935bcdc14..a7aa4e205d2b 100644
--- a/llvm/test/ObjectYAML/MachO/DWARF2-AddrSize8-FormValues.yaml
+++ b/llvm/test/ObjectYAML/MachO/DWARF2-AddrSize8-FormValues.yaml
@@ -438,53 +438,17 @@ DWARF:
#CHECK: Values:
#CHECK: - Value: 0x0123456789ABCDEF
#CHECK: - Value: 0x000000000000000A
-#CHECK: BlockData:
-#CHECK: - 0x01
-#CHECK: - 0x02
-#CHECK: - 0x03
-#CHECK: - 0x04
-#CHECK: - 0x05
-#CHECK: - 0x06
-#CHECK: - 0x07
-#CHECK: - 0x08
-#CHECK: - 0x09
-#CHECK: - 0x00
+#CHECK: BlockData: [ 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+#CHECK: 0x08, 0x09, 0x00 ]
#CHECK: - Value: 0x000000000000000A
-#CHECK: BlockData:
-#CHECK: - 0x01
-#CHECK: - 0x02
-#CHECK: - 0x03
-#CHECK: - 0x04
-#CHECK: - 0x05
-#CHECK: - 0x06
-#CHECK: - 0x07
-#CHECK: - 0x08
-#CHECK: - 0x09
-#CHECK: - 0x00
+#CHECK: BlockData: [ 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+#CHECK: 0x08, 0x09, 0x00 ]
#CHECK: - Value: 0x000000000000000A
-#CHECK: BlockData:
-#CHECK: - 0x01
-#CHECK: - 0x02
-#CHECK: - 0x03
-#CHECK: - 0x04
-#CHECK: - 0x05
-#CHECK: - 0x06
-#CHECK: - 0x07
-#CHECK: - 0x08
-#CHECK: - 0x09
-#CHECK: - 0x00
+#CHECK: BlockData: [ 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+#CHECK: 0x08, 0x09, 0x00 ]
#CHECK: - Value: 0x000000000000000A
-#CHECK: BlockData:
-#CHECK: - 0x01
-#CHECK: - 0x02
-#CHECK: - 0x03
-#CHECK: - 0x04
-#CHECK: - 0x05
-#CHECK: - 0x06
-#CHECK: - 0x07
-#CHECK: - 0x08
-#CHECK: - 0x09
-#CHECK: - 0x00
+#CHECK: BlockData: [ 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+#CHECK: 0x08, 0x09, 0x00 ]
#CHECK: - Value: 0x0000000000000001
#CHECK: - Value: 0x0000000000002345
#CHECK: - Value: 0x000000006789ABCD
diff --git a/llvm/test/ObjectYAML/MachO/DWARF5-debug_info.yaml b/llvm/test/ObjectYAML/MachO/DWARF5-debug_info.yaml
index d0e81834b593..6387b132843e 100644
--- a/llvm/test/ObjectYAML/MachO/DWARF5-debug_info.yaml
+++ b/llvm/test/ObjectYAML/MachO/DWARF5-debug_info.yaml
@@ -532,8 +532,7 @@ DWARF:
#CHECK: - Value: 0x0000000100000F50
#CHECK: - Value: 0x0000000000000034
#CHECK: - Value: 0x0000000000000001
-#CHECK: BlockData:
-#CHECK: - 0x56
+#CHECK: BlockData: [ 0x56 ]
#CHECK: - Value: 0x0000000000000076
#CHECK: - Value: 0x0000000000000001
#CHECK: - Value: 0x0000000000000003
@@ -543,9 +542,7 @@ DWARF:
#CHECK: - AbbrCode: 0x00000003
#CHECK: Values:
#CHECK: - Value: 0x0000000000000002
-#CHECK: BlockData:
-#CHECK: - 0x91
-#CHECK: - 0x78
+#CHECK: BlockData: [ 0x91, 0x78 ]
#CHECK: - Value: 0x000000000000007B
#CHECK: - Value: 0x0000000000000001
#CHECK: - Value: 0x0000000000000003
@@ -553,9 +550,7 @@ DWARF:
#CHECK: - AbbrCode: 0x00000003
#CHECK: Values:
#CHECK: - Value: 0x0000000000000002
-#CHECK: BlockData:
-#CHECK: - 0x91
-#CHECK: - 0x70
+#CHECK: BlockData: [ 0x91, 0x70 ]
#CHECK: - Value: 0x0000000000000080
#CHECK: - Value: 0x0000000000000001
#CHECK: - Value: 0x0000000000000003
diff --git a/llvm/test/ObjectYAML/MachO/bind_opcode.yaml b/llvm/test/ObjectYAML/MachO/bind_opcode.yaml
index a83e524aef27..6cbf76073ed8 100644
--- a/llvm/test/ObjectYAML/MachO/bind_opcode.yaml
+++ b/llvm/test/ObjectYAML/MachO/bind_opcode.yaml
@@ -107,8 +107,7 @@ LinkEditData:
#CHECK: Imm: 1
#CHECK: - Opcode: BIND_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB
#CHECK: Imm: 2
-#CHECK: ULEBExtraData:
-#CHECK: - 0x0000000000000000
+#CHECK: ULEBExtraData: [ 0x0000000000000000 ]
#CHECK: - Opcode: BIND_OPCODE_DO_BIND
#CHECK: Imm: 0
#CHECK: - Opcode: BIND_OPCODE_SET_SYMBOL_TRAILING_FLAGS_IMM
diff --git a/llvm/test/ObjectYAML/MachO/bogus_load_command.yaml b/llvm/test/ObjectYAML/MachO/bogus_load_command.yaml
index f37f733b34cf..448e0cbe80ae 100644
--- a/llvm/test/ObjectYAML/MachO/bogus_load_command.yaml
+++ b/llvm/test/ObjectYAML/MachO/bogus_load_command.yaml
@@ -36,17 +36,6 @@ LoadCommands:
#CHECK: ZeroPadBytes:
#CHECK: - cmd: 0xDEADBEEF
#CHECK: cmdsize: 24
-#CHECK: PayloadBytes:
-#CHECK: - 0x01
-#CHECK: - 0x02
-#CHECK: - 0x03
-#CHECK: - 0x04
-#CHECK: - 0x05
-#CHECK: - 0x06
-#CHECK: - 0x07
-#CHECK: - 0x08
-#CHECK: - 0x09
-#CHECK: - 0x0A
-#CHECK: - 0x0B
-#CHECK: - 0x0C
+#CHECK: PayloadBytes: [ 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08,
+#CHECK: 0x09, 0x0A, 0x0B, 0x0C, 0x00, 0x00, 0x00, 0x00 ]
#CHECK-NOT: LinkEditData:
diff --git a/llvm/test/ObjectYAML/MachO/lazy_bind_opcode.yaml b/llvm/test/ObjectYAML/MachO/lazy_bind_opcode.yaml
index fafe7b206f73..0db0ea1f902e 100644
--- a/llvm/test/ObjectYAML/MachO/lazy_bind_opcode.yaml
+++ b/llvm/test/ObjectYAML/MachO/lazy_bind_opcode.yaml
@@ -267,8 +267,7 @@ LinkEditData:
#CHECK: LazyBindOpcodes:
#CHECK: - Opcode: BIND_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB
#CHECK: Imm: 2
-#CHECK: ULEBExtraData:
-#CHECK: - 0x0000000000000028
+#CHECK: ULEBExtraData: [ 0x0000000000000028 ]
#CHECK: - Opcode: BIND_OPCODE_SET_DYLIB_ORDINAL_IMM
#CHECK: Imm: 1
#CHECK: - Opcode: BIND_OPCODE_SET_SYMBOL_TRAILING_FLAGS_IMM
@@ -280,8 +279,7 @@ LinkEditData:
#CHECK: Imm: 0
#CHECK: - Opcode: BIND_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB
#CHECK: Imm: 2
-#CHECK: ULEBExtraData:
-#CHECK: - 0x0000000000000030
+#CHECK: ULEBExtraData: [ 0x0000000000000030 ]
#CHECK: - Opcode: BIND_OPCODE_SET_DYLIB_ORDINAL_IMM
#CHECK: Imm: 1
#CHECK: - Opcode: BIND_OPCODE_SET_SYMBOL_TRAILING_FLAGS_IMM
@@ -293,8 +291,7 @@ LinkEditData:
#CHECK: Imm: 0
#CHECK: - Opcode: BIND_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB
#CHECK: Imm: 2
-#CHECK: ULEBExtraData:
-#CHECK: - 0x0000000000000038
+#CHECK: ULEBExtraData: [ 0x0000000000000038 ]
#CHECK: - Opcode: BIND_OPCODE_SET_DYLIB_ORDINAL_IMM
#CHECK: Imm: 1
#CHECK: - Opcode: BIND_OPCODE_SET_SYMBOL_TRAILING_FLAGS_IMM
@@ -306,8 +303,7 @@ LinkEditData:
#CHECK: Imm: 0
#CHECK: - Opcode: BIND_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB
#CHECK: Imm: 2
-#CHECK: ULEBExtraData:
-#CHECK: - 0x0000000000000040
+#CHECK: ULEBExtraData: [ 0x0000000000000040 ]
#CHECK: - Opcode: BIND_OPCODE_SET_DYLIB_ORDINAL_IMM
#CHECK: Imm: 1
#CHECK: - Opcode: BIND_OPCODE_SET_SYMBOL_TRAILING_FLAGS_IMM
@@ -319,8 +315,7 @@ LinkEditData:
#CHECK: Imm: 0
#CHECK: - Opcode: BIND_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB
#CHECK: Imm: 2
-#CHECK: ULEBExtraData:
-#CHECK: - 0x0000000000000048
+#CHECK: ULEBExtraData: [ 0x0000000000000048 ]
#CHECK: - Opcode: BIND_OPCODE_SET_DYLIB_ORDINAL_IMM
#CHECK: Imm: 1
#CHECK: - Opcode: BIND_OPCODE_SET_SYMBOL_TRAILING_FLAGS_IMM
@@ -332,8 +327,7 @@ LinkEditData:
#CHECK: Imm: 0
#CHECK: - Opcode: BIND_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB
#CHECK: Imm: 2
-#CHECK: ULEBExtraData:
-#CHECK: - 0x0000000000000050
+#CHECK: ULEBExtraData: [ 0x0000000000000050 ]
#CHECK: - Opcode: BIND_OPCODE_SET_DYLIB_ORDINAL_IMM
#CHECK: Imm: 1
#CHECK: - Opcode: BIND_OPCODE_SET_SYMBOL_TRAILING_FLAGS_IMM
@@ -345,8 +339,7 @@ LinkEditData:
#CHECK: Imm: 0
#CHECK: - Opcode: BIND_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB
#CHECK: Imm: 2
-#CHECK: ULEBExtraData:
-#CHECK: - 0x0000000000000058
+#CHECK: ULEBExtraData: [ 0x0000000000000058 ]
#CHECK: - Opcode: BIND_OPCODE_SET_DYLIB_ORDINAL_IMM
#CHECK: Imm: 1
#CHECK: - Opcode: BIND_OPCODE_SET_SYMBOL_TRAILING_FLAGS_IMM
@@ -358,8 +351,7 @@ LinkEditData:
#CHECK: Imm: 0
#CHECK: - Opcode: BIND_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB
#CHECK: Imm: 2
-#CHECK: ULEBExtraData:
-#CHECK: - 0x0000000000000060
+#CHECK: ULEBExtraData: [ 0x0000000000000060 ]
#CHECK: - Opcode: BIND_OPCODE_SET_DYLIB_ORDINAL_IMM
#CHECK: Imm: 1
#CHECK: - Opcode: BIND_OPCODE_SET_SYMBOL_TRAILING_FLAGS_IMM
@@ -371,8 +363,7 @@ LinkEditData:
#CHECK: Imm: 0
#CHECK: - Opcode: BIND_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB
#CHECK: Imm: 2
-#CHECK: ULEBExtraData:
-#CHECK: - 0x0000000000000068
+#CHECK: ULEBExtraData: [ 0x0000000000000068 ]
#CHECK: - Opcode: BIND_OPCODE_SET_DYLIB_ORDINAL_IMM
#CHECK: Imm: 1
#CHECK: - Opcode: BIND_OPCODE_SET_SYMBOL_TRAILING_FLAGS_IMM
@@ -384,8 +375,7 @@ LinkEditData:
#CHECK: Imm: 0
#CHECK: - Opcode: BIND_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB
#CHECK: Imm: 2
-#CHECK: ULEBExtraData:
-#CHECK: - 0x0000000000000070
+#CHECK: ULEBExtraData: [ 0x0000000000000070 ]
#CHECK: - Opcode: BIND_OPCODE_SET_DYLIB_ORDINAL_IMM
#CHECK: Imm: 1
#CHECK: - Opcode: BIND_OPCODE_SET_SYMBOL_TRAILING_FLAGS_IMM
@@ -397,8 +387,7 @@ LinkEditData:
#CHECK: Imm: 0
#CHECK: - Opcode: BIND_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB
#CHECK: Imm: 2
-#CHECK: ULEBExtraData:
-#CHECK: - 0x0000000000000078
+#CHECK: ULEBExtraData: [ 0x0000000000000078 ]
#CHECK: - Opcode: BIND_OPCODE_SET_DYLIB_ORDINAL_IMM
#CHECK: Imm: 1
#CHECK: - Opcode: BIND_OPCODE_SET_SYMBOL_TRAILING_FLAGS_IMM
@@ -410,8 +399,7 @@ LinkEditData:
#CHECK: Imm: 0
#CHECK: - Opcode: BIND_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB
#CHECK: Imm: 2
-#CHECK: ULEBExtraData:
-#CHECK: - 0x0000000000000080
+#CHECK: ULEBExtraData: [ 0x0000000000000080 ]
#CHECK: - Opcode: BIND_OPCODE_SET_DYLIB_ORDINAL_IMM
#CHECK: Imm: 1
#CHECK: - Opcode: BIND_OPCODE_SET_SYMBOL_TRAILING_FLAGS_IMM
@@ -423,8 +411,7 @@ LinkEditData:
#CHECK: Imm: 0
#CHECK: - Opcode: BIND_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB
#CHECK: Imm: 2
-#CHECK: ULEBExtraData:
-#CHECK: - 0x0000000000000088
+#CHECK: ULEBExtraData: [ 0x0000000000000088 ]
#CHECK: - Opcode: BIND_OPCODE_SET_DYLIB_ORDINAL_IMM
#CHECK: Imm: 2
#CHECK: - Opcode: BIND_OPCODE_SET_SYMBOL_TRAILING_FLAGS_IMM
@@ -436,8 +423,7 @@ LinkEditData:
#CHECK: Imm: 0
#CHECK: - Opcode: BIND_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB
#CHECK: Imm: 2
-#CHECK: ULEBExtraData:
-#CHECK: - 0x0000000000000090
+#CHECK: ULEBExtraData: [ 0x0000000000000090 ]
#CHECK: - Opcode: BIND_OPCODE_SET_DYLIB_ORDINAL_IMM
#CHECK: Imm: 2
#CHECK: - Opcode: BIND_OPCODE_SET_SYMBOL_TRAILING_FLAGS_IMM
@@ -449,8 +435,7 @@ LinkEditData:
#CHECK: Imm: 0
#CHECK: - Opcode: BIND_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB
#CHECK: Imm: 2
-#CHECK: ULEBExtraData:
-#CHECK: - 0x0000000000000098
+#CHECK: ULEBExtraData: [ 0x0000000000000098 ]
#CHECK: - Opcode: BIND_OPCODE_SET_DYLIB_ORDINAL_IMM
#CHECK: Imm: 2
#CHECK: - Opcode: BIND_OPCODE_SET_SYMBOL_TRAILING_FLAGS_IMM
diff --git a/llvm/test/ObjectYAML/MachO/out_of_order_linkedit.yaml b/llvm/test/ObjectYAML/MachO/out_of_order_linkedit.yaml
index 5f2596103864..81db5deb785e 100644
--- a/llvm/test/ObjectYAML/MachO/out_of_order_linkedit.yaml
+++ b/llvm/test/ObjectYAML/MachO/out_of_order_linkedit.yaml
@@ -214,12 +214,10 @@ LinkEditData:
#CHECK: Imm: 1
#CHECK: - Opcode: REBASE_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB
#CHECK: Imm: 2
-#CHECK: ExtraData:
-#CHECK: - 0x0000000000000028
+#CHECK: ExtraData: [ 0x0000000000000028 ]
#CHECK: - Opcode: REBASE_OPCODE_DO_REBASE_ULEB_TIMES
#CHECK: Imm: 0
-#CHECK: ExtraData:
-#CHECK: - 0x000000000000000F
+#CHECK: ExtraData: [ 0x000000000000000F ]
#CHECK: - Opcode: REBASE_OPCODE_DONE
#CHECK: Imm: 0
#CHECK: BindOpcodes:
@@ -234,8 +232,7 @@ LinkEditData:
#CHECK: Symbol: ''
#CHECK: - Opcode: BIND_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB
#CHECK: Imm: 2
-#CHECK: ULEBExtraData:
-#CHECK: - 0x0000000000000000
+#CHECK: ULEBExtraData: [ 0x0000000000000000 ]
#CHECK: Symbol: ''
#CHECK: - Opcode: BIND_OPCODE_DO_BIND
#CHECK: Imm: 0
diff --git a/llvm/test/ObjectYAML/MachO/rebase_opcode.yaml b/llvm/test/ObjectYAML/MachO/rebase_opcode.yaml
index a50c80b385fa..8e8ec979c3b7 100644
--- a/llvm/test/ObjectYAML/MachO/rebase_opcode.yaml
+++ b/llvm/test/ObjectYAML/MachO/rebase_opcode.yaml
@@ -82,11 +82,9 @@ LinkEditData:
#CHECK: Imm: 1
#CHECK: - Opcode: REBASE_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB
#CHECK: Imm: 2
-#CHECK: ExtraData:
-#CHECK: - 0x0000000000000028
+#CHECK: ExtraData: [ 0x0000000000000028 ]
#CHECK: - Opcode: REBASE_OPCODE_DO_REBASE_ULEB_TIMES
#CHECK: Imm: 0
-#CHECK: ExtraData:
-#CHECK: - 0x000000000000000F
+#CHECK: ExtraData: [ 0x000000000000000F ]
#CHECK: - Opcode: REBASE_OPCODE_DONE
#CHECK: Imm: 0
diff --git a/llvm/test/ObjectYAML/MachO/weak_bind_opcode.yaml b/llvm/test/ObjectYAML/MachO/weak_bind_opcode.yaml
index a674b0e022e5..bda4386665ba 100644
--- a/llvm/test/ObjectYAML/MachO/weak_bind_opcode.yaml
+++ b/llvm/test/ObjectYAML/MachO/weak_bind_opcode.yaml
@@ -107,8 +107,7 @@ LinkEditData:
#CHECK: Imm: 1
#CHECK: - Opcode: BIND_OPCODE_SET_SEGMENT_AND_OFFSET_ULEB
#CHECK: Imm: 2
-#CHECK: ULEBExtraData:
-#CHECK: - 0x0000000000000000
+#CHECK: ULEBExtraData: [ 0x0000000000000000 ]
#CHECK: - Opcode: BIND_OPCODE_DO_BIND
#CHECK: Imm: 0
#CHECK: - Opcode: BIND_OPCODE_SET_SYMBOL_TRAILING_FLAGS_IMM
diff --git a/llvm/unittests/Support/YAMLIOTest.cpp b/llvm/unittests/Support/YAMLIOTest.cpp
index 0c9df1170317..202bfb377e16 100644
--- a/llvm/unittests/Support/YAMLIOTest.cpp
+++ b/llvm/unittests/Support/YAMLIOTest.cpp
@@ -2189,7 +2189,6 @@ TEST(YAMLIO, TestReadBuiltInTypesDoubleError) {
//
// Test error handling reading built-in Hex8 type
//
-LLVM_YAML_IS_SEQUENCE_VECTOR(Hex8)
TEST(YAMLIO, TestReadBuiltInTypesHex8Error) {
std::vector<Hex8> seq;
Input yin("---\n"
@@ -2200,15 +2199,26 @@ TEST(YAMLIO, TestReadBuiltInTypesHex8Error) {
/*Ctxt=*/nullptr,
suppressErrorMessages);
yin >> seq;
-
EXPECT_TRUE(!!yin.error());
+
+ std::vector<Hex8> seq2;
+ Input yin2("---\n"
+ "[ 0x12, 0xFE, 0x123 ]\n"
+ "...\n",
+ /*Ctxt=*/nullptr, suppressErrorMessages);
+ yin2 >> seq2;
+ EXPECT_TRUE(!!yin2.error());
+
+ EXPECT_TRUE(seq.size() == 3);
+ EXPECT_TRUE(seq.size() == seq2.size());
+ for (size_t i = 0; i < seq.size(); ++i)
+ EXPECT_TRUE(seq[i] == seq2[i]);
}
//
// Test error handling reading built-in Hex16 type
//
-LLVM_YAML_IS_SEQUENCE_VECTOR(Hex16)
TEST(YAMLIO, TestReadBuiltInTypesHex16Error) {
std::vector<Hex16> seq;
Input yin("---\n"
@@ -2219,14 +2229,25 @@ TEST(YAMLIO, TestReadBuiltInTypesHex16Error) {
/*Ctxt=*/nullptr,
suppressErrorMessages);
yin >> seq;
-
EXPECT_TRUE(!!yin.error());
+
+ std::vector<Hex16> seq2;
+ Input yin2("---\n"
+ "[ 0x0012, 0xFEFF, 0x12345 ]\n"
+ "...\n",
+ /*Ctxt=*/nullptr, suppressErrorMessages);
+ yin2 >> seq2;
+ EXPECT_TRUE(!!yin2.error());
+
+ EXPECT_TRUE(seq.size() == 3);
+ EXPECT_TRUE(seq.size() == seq2.size());
+ for (size_t i = 0; i < seq.size(); ++i)
+ EXPECT_TRUE(seq[i] == seq2[i]);
}
//
// Test error handling reading built-in Hex32 type
//
-LLVM_YAML_IS_SEQUENCE_VECTOR(Hex32)
TEST(YAMLIO, TestReadBuiltInTypesHex32Error) {
std::vector<Hex32> seq;
Input yin("---\n"
@@ -2239,12 +2260,24 @@ TEST(YAMLIO, TestReadBuiltInTypesHex32Error) {
yin >> seq;
EXPECT_TRUE(!!yin.error());
+
+ std::vector<Hex32> seq2;
+ Input yin2("---\n"
+ "[ 0x0012, 0xFEFF0000, 0x1234556789 ]\n"
+ "...\n",
+ /*Ctxt=*/nullptr, suppressErrorMessages);
+ yin2 >> seq2;
+ EXPECT_TRUE(!!yin2.error());
+
+ EXPECT_TRUE(seq.size() == 3);
+ EXPECT_TRUE(seq.size() == seq2.size());
+ for (size_t i = 0; i < seq.size(); ++i)
+ EXPECT_TRUE(seq[i] == seq2[i]);
}
//
// Test error handling reading built-in Hex64 type
//
-LLVM_YAML_IS_SEQUENCE_VECTOR(Hex64)
TEST(YAMLIO, TestReadBuiltInTypesHex64Error) {
std::vector<Hex64> seq;
Input yin("---\n"
@@ -2255,8 +2288,20 @@ TEST(YAMLIO, TestReadBuiltInTypesHex64Error) {
/*Ctxt=*/nullptr,
suppressErrorMessages);
yin >> seq;
-
EXPECT_TRUE(!!yin.error());
+
+ std::vector<Hex64> seq2;
+ Input yin2("---\n"
+ "[ 0x0012, 0xFFEEDDCCBBAA9988, 0x12345567890ABCDEF0 ]\n"
+ "...\n",
+ /*Ctxt=*/nullptr, suppressErrorMessages);
+ yin2 >> seq2;
+ EXPECT_TRUE(!!yin2.error());
+
+ EXPECT_TRUE(seq.size() == 3);
+ EXPECT_TRUE(seq.size() == seq2.size());
+ for (size_t i = 0; i < seq.size(); ++i)
+ EXPECT_TRUE(seq[i] == seq2[i]);
}
TEST(YAMLIO, TestMalformedMapFailsGracefully) {
More information about the llvm-commits
mailing list