dw2-icc-opaque.exp 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. # Copyright (C) 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. load_lib dwarf.exp
  15. # Test that we can correctly resolve opaque structures compiled by the Intel
  16. # compiler, which does not set DW_AT_declaration on opaque structure types.
  17. # This is GDB PR symtab/13277.
  18. # This test can only be run on targets which support DWARF-2 and use gas.
  19. if {![dwarf2_support]} {
  20. return 0
  21. }
  22. standard_testfile .S
  23. set executable ${testfile}
  24. if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" object {}] != "" } {
  25. return -1
  26. }
  27. clean_restart $executable
  28. # Before PR 13277 was fixed, this would output:
  29. # type = struct opaque_struct_t {
  30. # <no data fields>
  31. # } *
  32. if { [istarget s390x-*-*] && [is_lp64_target] } {
  33. # The hand-coded DWARF info hard-codes a pointer size of 4 bytes,
  34. # which is represented as @mode32 on s390x.
  35. gdb_test "ptype p_struct" "type = struct opaque_struct_t {\r\n *int wrapped_value;\r\n} \\* @mode32"
  36. } else {
  37. gdb_test "ptype p_struct" "type = struct opaque_struct_t {\r\n *int wrapped_value;\r\n} \\*"
  38. }