dw2-ifort-parameter.exp 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. # Copyright 2011-2022 Free Software Foundation, Inc.
  2. # This program is free software; you can redistribute it and/or modify
  3. # it under the terms of the GNU General Public License as published by
  4. # the Free Software Foundation; either version 3 of the License, or
  5. # (at your option) any later version.
  6. #
  7. # This program is distributed in the hope that it will be useful,
  8. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. # GNU General Public License for more details.
  11. #
  12. # You should have received a copy of the GNU General Public License
  13. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  14. # Verify DW_AT_variable_parameter does not modify the data structures meaning
  15. # for GDB, as being used by iFort.
  16. load_lib dwarf.exp
  17. # This test can only be run on targets which support DWARF-2 and use gas.
  18. if {![dwarf2_support]} {
  19. return 0
  20. }
  21. standard_testfile .c -dw.S
  22. # Make some DWARF for the test.
  23. set asm_file [standard_output_file $srcfile2]
  24. Dwarf::assemble $asm_file {
  25. declare_labels int_label
  26. cu {} {
  27. compile_unit {
  28. {name file1.txt}
  29. {language @DW_LANG_C}
  30. {MACRO_AT_range { func }}
  31. } {
  32. int_label: base_type {
  33. {name int}
  34. {byte_size 4 sdata}
  35. {encoding @DW_ATE_signed}
  36. }
  37. subprogram {
  38. {external 1 flag}
  39. {MACRO_AT_func { func }}
  40. } {
  41. formal_parameter {
  42. {name param}
  43. {variable_parameter 1 flag}
  44. {type :$int_label}
  45. {location {
  46. addr [gdb_target_symbol ptr]
  47. deref
  48. } SPECIAL_expr}
  49. }
  50. }
  51. }
  52. }
  53. }
  54. if { [prepare_for_testing "failed to prepare" ${testfile} \
  55. [list $srcfile $asm_file] {nodebug}] } {
  56. return -1
  57. }
  58. if ![runto func] {
  59. return -1
  60. }
  61. gdb_test "p/x param" " = 0xdeadf00d"