diff options
-rw-r--r-- | gdb/testsuite/gdb.fortran/ptype-on-functions.exp | 36 |
1 files changed, 29 insertions, 7 deletions
diff --git a/gdb/testsuite/gdb.fortran/ptype-on-functions.exp b/gdb/testsuite/gdb.fortran/ptype-on-functions.exp index 14f522d..7519795 100644 --- a/gdb/testsuite/gdb.fortran/ptype-on-functions.exp +++ b/gdb/testsuite/gdb.fortran/ptype-on-functions.exp @@ -29,23 +29,45 @@ if ![fortran_runto_main] then { continue } +set integer4 [fortran_int4] +set logical4 [fortran_logical4] +set integer8 [fortran_int8] + +if {[test_compiler_info {clang-*}]} { + set some_module_class_type "Type number" + set some_module_aux_info ", $integer8 \\(10\\)" +} else { + set some_module_class_type "Type __class_some_module_Number(_t)?" + set some_module_aux_info "" +} + gdb_test "ptype some_module::get_number" \ - "type = integer\\(kind=4\\) \\(Type __class_some_module_Number(_t)?\\)" + "type = $integer4 \\(${some_module_class_type}${some_module_aux_info}\\)" gdb_test "ptype some_module::set_number" \ - "type = void \\(Type __class_some_module_Number(_t)?, integer\\(kind=4\\)\\)" + "type = void \\(${some_module_class_type}, $integer4${some_module_aux_info}\\)" gdb_test "ptype is_bigger" \ - "type = logical\\(kind=4\\) \\(integer\\(kind=4\\), integer\\(kind=4\\)\\)" + "type = $logical4 \\($integer4, $integer4\\)" gdb_test "ptype say_numbers" \ - "type = void \\(integer\\(kind=4\\), integer\\(kind=4\\), integer\\(kind=4\\)\\)" + "type = void \\($integer4, $integer4, $integer4\\)" + +set fun_ptr_arg "$integer4" +if {[test_compiler_info {gcc-*}]} { + set fun_ptr_arg "REF TO -> \\( ${fun_ptr_arg} \\)" +} gdb_test "ptype fun_ptr" \ - "type = PTR TO -> \\( integer\\(kind=4\\) \\(\\) \\(REF TO -> \\( integer\\(kind=4\\) \\)\\) \\)" + "type = PTR TO -> \\( $integer4 \\(\\) \\(${fun_ptr_arg}\\) \\)" gdb_test "ptype say_string" \ - "type = void \\(character\\*\\(\\*\\), integer\\(kind=\\d+\\)\\)" + "type = void \\(character\[^,\]+, $integer8\\)" + +set say_array_artificial_first_arg "" +if {[test_compiler_info {clang-*}]} { + set say_array_artificial_first_arg "$integer8, " +} gdb_test "ptype say_array" \ - "type = void \\(integer\\(kind=4\\) \\(:,:\\)\\)" + "type = void \\(${say_array_artificial_first_arg}$integer4 \\(:,:\\)\\)" |