diff options
-rw-r--r-- | gdb/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/testsuite/gdb.rust/simple.exp | 56 |
2 files changed, 56 insertions, 5 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 4adf16a..4191661 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2019-10-09 Tom de Vries <tdevries@suse.de> + + PR testsuite/25048 + * gdb.rust/simple.exp: Add xfails for incorrect DWARF. + 2019-10-07 Andrew Burgess <andrew.burgess@embecosm.com> * gdb.ada/catch_ex_std.exp: Handle being unabled to catch Ada diff --git a/gdb/testsuite/gdb.rust/simple.exp b/gdb/testsuite/gdb.rust/simple.exp index dcbfb90..d3edbd7 100644 --- a/gdb/testsuite/gdb.rust/simple.exp +++ b/gdb/testsuite/gdb.rust/simple.exp @@ -200,7 +200,16 @@ gdb_test "print e2.notexist" \ gdb_test "print e2.0" \ "Variant simple::MoreComplicated::Four is not a tuple variant" -gdb_test "print k" " = simple::SpaceSaver::Nothing" +set pass_pattern " = simple::SpaceSaver::Nothing" +set xfail_pattern " = simple::SpaceSaver::Thebox\\($decimal, 0x0\\)" +gdb_test_multiple "print k" "" { + -re "\[\r\n\]*(?:$pass_pattern)\[\r\n\]+$gdb_prompt $" { + pass $gdb_test_name + } + -re "\[\r\n\]*(?:$xfail_pattern)\[\r\n\]+$gdb_prompt $" { + xfail $gdb_test_name + } +} gdb_test "print l" " = simple::SpaceSaver::Thebox\\(9, $hex\\)" gdb_test "print *l.1" " = 1729" @@ -228,16 +237,53 @@ gdb_test "print ..=5" " = .*::ops::RangeToInclusive.* \\{end: 5\\}" gdb_test "print 5.." " = .*::ops::RangeFrom.* \\{start: 5\\}" gdb_test "print .." " = .*::ops::RangeFull" -gdb_test "print str_some" \ +set pass_pattern \ " = core::option::Option<\[a-z\]+::string::String>::Some\\(\[a-z\]+::string::String .*" -gdb_test "print str_none" " = core::option::Option<\[a-z\]+::string::String>::None" +set xfail_pattern " = <error reading variable>" +gdb_test_multiple "print str_some" "" { + -re "\[\r\n\]*(?:$pass_pattern)\[\r\n\]+$gdb_prompt $" { + pass $gdb_test_name + } + -re "\[\r\n\]*(?:$xfail_pattern)\[\r\n\]+$gdb_prompt $" { + xfail $gdb_test_name + } +} + +set pass_pattern " = core::option::Option<\[a-z\]+::string::String>::None" +gdb_test_multiple "print str_none" "" { + -re "\[\r\n\]*(?:$pass_pattern)\[\r\n\]+$gdb_prompt $" { + pass $gdb_test_name + } + -re "\[\r\n\]*(?:$xfail_pattern)\[\r\n\]+$gdb_prompt $" { + xfail $gdb_test_name + } +} + gdb_test "print int_some" " = core::option::Option<u8>::Some\\(1\\)" gdb_test "print int_none" " = core::option::Option<u8>::None" gdb_test "print box_some" " = core::option::Option<\[a-z:\]*Box<u8>>::Some\\(.*\\)" gdb_test "print box_none" " = core::option::Option<\[a-z:\]*Box<u8>>::None" -gdb_test "print custom_some" \ + +set pass_pattern \ " = simple::NonZeroOptimized::Value\\(\[a-z\]+::string::String .*" -gdb_test "print custom_none" " = simple::NonZeroOptimized::Empty" +gdb_test_multiple "print custom_some" "" { + -re "\[\r\n\]*(?:$pass_pattern)\[\r\n\]+$gdb_prompt $" { + pass $gdb_test_name + } + -re "\[\r\n\]*(?:$xfail_pattern)\[\r\n\]+$gdb_prompt $" { + xfail $gdb_test_name + } +} + +set pass_pattern " = simple::NonZeroOptimized::Empty" +gdb_test_multiple "print custom_none" "" { + -re "\[\r\n\]*(?:$pass_pattern)\[\r\n\]+$gdb_prompt $" { + pass $gdb_test_name + } + -re "\[\r\n\]*(?:$xfail_pattern)\[\r\n\]+$gdb_prompt $" { + xfail $gdb_test_name + } +} gdb_test "print st" \ " = simple::StringAtOffset {field1: \"hello\", field2: 1, field3: \"world\"}" |