diff options
author | Tom Tromey <tromey@adacore.com> | 2020-04-24 13:40:31 -0600 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2020-04-24 13:40:33 -0600 |
commit | adfb981595c1ea12736b6d3c4686973040f171ff (patch) | |
tree | a008a9b892732f5ca28604778faf5e11fcafb1af /gdb/testsuite/gdb.ada/packed_tagged.exp | |
parent | d656f129ebc7b96db96244d0206fc7fb9af85a65 (diff) | |
download | gdb-adfb981595c1ea12736b6d3c4686973040f171ff.zip gdb-adfb981595c1ea12736b6d3c4686973040f171ff.tar.gz gdb-adfb981595c1ea12736b6d3c4686973040f171ff.tar.bz2 |
Add tests for Ada changes
The previous patches largely came without test cases. This was done
to make the patches easier to review; as most of the patches were
needed before existing tests could be updated.
This patch adds a new test and updates some existing tests to test all
the settings of -fgnat-encodings. This ensures that tests are run
both with the old-style "magic symbol name" encoding, and the
new-style DWARF encoding.
Note that in one case, a test is modified to be more lax. See the
comment in mi_var_array.exp. I didn't want to fix this in this
series, as it's already complicated enough. However, I think it could
be fixed; I will file a bug for it.
gdb/testsuite/ChangeLog
2020-04-24 Tom Tromey <tromey@adacore.com>
* gdb.ada/mi_var_array.exp: Try all -fgnat-encodings settings.
Make array type matching more lax.
* gdb.ada/mi_var_union.exp: Try all -fgnat-encodings settings.
* gdb.ada/mi_variant.exp: New file.
* gdb.ada/mi_variant/pck.ads: New file.
* gdb.ada/mi_variant/pkg.adb: New file.
* gdb.ada/packed_tagged.exp: Try all -fgnat-encodings settings.
* gdb.ada/unchecked_union.exp: Try all -fgnat-encodings settings.
Diffstat (limited to 'gdb/testsuite/gdb.ada/packed_tagged.exp')
-rw-r--r-- | gdb/testsuite/gdb.ada/packed_tagged.exp | 41 |
1 files changed, 24 insertions, 17 deletions
diff --git a/gdb/testsuite/gdb.ada/packed_tagged.exp b/gdb/testsuite/gdb.ada/packed_tagged.exp index 2670dad..72ae29c 100644 --- a/gdb/testsuite/gdb.ada/packed_tagged.exp +++ b/gdb/testsuite/gdb.ada/packed_tagged.exp @@ -17,24 +17,31 @@ load_lib "ada.exp" standard_ada_testfile comp_bug -if {[gdb_compile_ada "${srcfile}" "${binfile}" executable [list debug]] != "" } { - return -1 -} +foreach_with_prefix scenario {none all minimal} { + set flags {debug} + if {$scenario != "none"} { + lappend flags additional_flags=-fgnat-encodings=$scenario + } + + if {[gdb_compile_ada "${srcfile}" "${binfile}" executable $flags] != ""} { + return -1 + } -clean_restart ${testfile} + clean_restart ${testfile} -set bp_location [gdb_get_line_number "STOP" ${testdir}/comp_bug.adb] -runto "comp_bug.adb:$bp_location" + set bp_location [gdb_get_line_number "STOP" ${testdir}/comp_bug.adb] + runto "comp_bug.adb:$bp_location" -gdb_test "print x" \ - "= \\(exists => true, value => 10\\)" + gdb_test "print x" \ + "= \\(exists => true, value => 10\\)" -gdb_test "ptype x" \ - [multi_line "type = record" \ - " exists: (boolean|range false \\.\\. true);" \ - " case exists is" \ - " when true =>" \ - " value: range 0 \\.\\. 255;" \ - " when others => null;" \ - " end case;" \ - "end record" ] + gdb_test "ptype x" \ + [multi_line "type = record" \ + " exists: (boolean|range false \\.\\. true);" \ + " case exists is" \ + " when true =>" \ + " value: range 0 \\.\\. 255;" \ + " when others => null;" \ + " end case;" \ + "end record" ] +} |