summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/testsuite/gdb.dwarf2/subrange.exp25
1 files changed, 25 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.dwarf2/subrange.exp b/gdb/testsuite/gdb.dwarf2/subrange.exp
index 72d7babc88e..97743ee1099 100644
--- a/gdb/testsuite/gdb.dwarf2/subrange.exp
+++ b/gdb/testsuite/gdb.dwarf2/subrange.exp
@@ -28,6 +28,7 @@ Dwarf::assemble $asm_file {
compile_unit {{language @DW_LANG_Pascal83}} {
declare_labels byte_label typedef_label array_label
+ # A subrange's underlying type that is a typedef.
byte_label: base_type {
{name byte}
{encoding @DW_ATE_unsigned}
@@ -54,6 +55,28 @@ Dwarf::assemble $asm_file {
{name TByteArray}
{type :$array_label}
}
+
+ # This subrange's underlying type is signed, but the bounds are
+ # specified using a non-signed form.
+ declare_labels signed_byte_label subrange_with_buggy_negative_bounds_label
+
+ signed_byte_label: base_type {
+ {name signed_byte}
+ {encoding @DW_ATE_signed}
+ {byte_size 1 DW_FORM_sdata}
+ }
+
+ # The bounds mean -16 to -12.
+ subrange_with_buggy_negative_bounds_label: subrange_type {
+ {lower_bound 0xf0 DW_FORM_udata}
+ {upper_bound 0xf4 DW_FORM_udata}
+ {type :$signed_byte_label}
+ }
+
+ DW_TAG_variable {
+ {name subrange_with_buggy_negative_bounds_variable}
+ {type :$subrange_with_buggy_negative_bounds_label}
+ }
}
}
}
@@ -67,3 +90,5 @@ gdb_test_no_output "set language pascal"
gdb_test "ptype TByteArray" \
"type = array \\\[0\\.\\.191\\\] of byte"
+gdb_test "ptype subrange_with_buggy_negative_bounds_variable" \
+ "type = -16\\.\\.-12"