big_packed_array.exp 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. # Copyright 2019-2022 Free Software Foundation, Inc.
  2. #
  3. # This program is free software; you can redistribute it and/or modify
  4. # it under the terms of the GNU General Public License as published by
  5. # the Free Software Foundation; either version 3 of the License, or
  6. # (at your option) any later version.
  7. #
  8. # This program is distributed in the hope that it will be useful,
  9. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. # GNU General Public License for more details.
  12. #
  13. # You should have received a copy of the GNU General Public License
  14. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. load_lib "ada.exp"
  16. if { [skip_ada_tests] } { return -1 }
  17. standard_ada_testfile foo_ra24_010
  18. if [get_compiler_info] {
  19. return -1
  20. }
  21. set old_gcc [expr [test_compiler_info {gcc-[0-8]-*}]]
  22. foreach_with_prefix scenario {all minimal} {
  23. set flags [list debug additional_flags=-fgnat-encodings=$scenario]
  24. if {[gdb_compile_ada "${srcfile}" "${binfile}" executable $flags] != ""} {
  25. return -1
  26. }
  27. clean_restart ${testfile}
  28. set bp_location [gdb_get_line_number "STOP" ${testdir}/foo_ra24_010.adb]
  29. runto "foo_ra24_010.adb:$bp_location"
  30. gdb_test "print good" \
  31. "= \\(false <repeats 196 times>\\)" \
  32. set have_xfail [expr $old_gcc && [string equal "$scenario" "minimal"]]
  33. set re "= \\(false <repeats 196 times>\\)"
  34. set re_xfail "= \\(0 => 0 <repeats 25 times>\\)"
  35. set re_xfail2 "= \\(0 => 0 <repeats 24 times>, ($decimal)\\)"
  36. gdb_test_multiple "print bad" "" {
  37. -re -wrap $re {
  38. pass $gdb_test_name
  39. }
  40. -re -wrap $re_xfail {
  41. if { $have_xfail } {
  42. # gcc/101643
  43. setup_xfail *-*-*
  44. }
  45. fail $gdb_test_name
  46. }
  47. -re -wrap $re_xfail2 {
  48. set last $expect_out(1,string)
  49. if { $have_xfail && [string is integer $last] \
  50. && [expr ($last & 0xf) == 0] } {
  51. # gcc/101643
  52. setup_xfail *-*-*
  53. }
  54. fail $gdb_test_name
  55. }
  56. }
  57. }