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 | dac2fef7cfaf007123b521a70864d4dde3d09410 (patch) | |
tree | 993e6edf230c96f3c75af52ad663038ff88ec648 /gdb/testsuite/gdb.ada/packed_tagged.exp | |
parent | 1acda8039ba681e88416a7da6a6e3abdcae6b86b (diff) | |
download | gdb-dac2fef7cfaf007123b521a70864d4dde3d09410.zip gdb-dac2fef7cfaf007123b521a70864d4dde3d09410.tar.gz gdb-dac2fef7cfaf007123b521a70864d4dde3d09410.tar.bz2 |
Update test cases that work with minimal encodings
Some test cases already work fine with minimal encodings (in some
cases perhaps due to the variant parts series) This patch updates
these tests as appropriate.
gdb/testsuite/ChangeLog
2020-04-24 Tom Tromey <tromey@adacore.com>
* gdb.ada/frame_arg_lang.exp: Run with multiple -fgnat-encodings
values.
* gdb.ada/funcall_ref.exp: Run with multiple -fgnat-encodings
values. Update test for minimal encodings.
* gdb.ada/lang_switch.exp: Update test for minimal encodings.
* gdb.ada/var_rec_arr.exp: Run with multiple -fgnat-encodings
values. Update test for minimal encodings.
Diffstat (limited to 'gdb/testsuite/gdb.ada/packed_tagged.exp')
-rw-r--r-- | gdb/testsuite/gdb.ada/packed_tagged.exp | 46 |
1 files changed, 43 insertions, 3 deletions
diff --git a/gdb/testsuite/gdb.ada/packed_tagged.exp b/gdb/testsuite/gdb.ada/packed_tagged.exp index 72ae29c..d6ee845 100644 --- a/gdb/testsuite/gdb.ada/packed_tagged.exp +++ b/gdb/testsuite/gdb.ada/packed_tagged.exp @@ -17,7 +17,10 @@ load_lib "ada.exp" standard_ada_testfile comp_bug -foreach_with_prefix scenario {none all minimal} { +# Note we don't test the "none" (no -fgnat-encodings option) scenario +# here, because "all" and "minimal" cover the cases, and this way we +# don't have to update the test when gnat changes its default. +foreach_with_prefix scenario {all minimal} { set flags {debug} if {$scenario != "none"} { lappend flags additional_flags=-fgnat-encodings=$scenario @@ -32,10 +35,25 @@ foreach_with_prefix scenario {none all minimal} { set bp_location [gdb_get_line_number "STOP" ${testdir}/comp_bug.adb] runto "comp_bug.adb:$bp_location" - gdb_test "print x" \ + set pass_re \ "= \\(exists => true, value => 10\\)" + # There is a compiler bug that causes this output. + set kfail_re \ + "= \\(exists => true\\)" - gdb_test "ptype x" \ + gdb_test_multiple "print x" "" { + -re -wrap $pass_re { + pass $gdb_test_name + } + -re -wrap $kfail_re { + if {$scenario == "minimal"} { + setup_kfail "gnat compiler bug" *-*-* + } + fail $gdb_test_name + } + } + + set pass_re \ [multi_line "type = record" \ " exists: (boolean|range false \\.\\. true);" \ " case exists is" \ @@ -44,4 +62,26 @@ foreach_with_prefix scenario {none all minimal} { " when others => null;" \ " end case;" \ "end record" ] + # There is a compiler bug that causes this output. + set kfail_re \ + [multi_line "type = record" \ + " exists: (boolean|range false \\.\\. true);" \ + " case \\? is" \ + " when others =>" \ + " value: range 0 \\.\\. 255;" \ + " when others => null;" \ + " end case;" \ + "end record" ] + + gdb_test_multiple "ptype x" "" { + -re -wrap $pass_re { + pass $gdb_test_name + } + -re -wrap $kfail_re { + if {$scenario == "minimal"} { + setup_kfail "gnat compiler bug" *-*-* + } + fail $gdb_test_name + } + } } |