aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite
diff options
context:
space:
mode:
authorBhuvanendra Kumar N <Bhuvanendra.KumarN@amd.com>2021-06-28 10:51:57 +0530
committerAlok Kumar Sharma <AlokKumar.Sharma@amd.com>2021-06-28 10:56:03 +0530
commit05b857720611bc2e1f9cca2573085b774181af9d (patch)
tree4a693adde8d91ae186a09a35628894cc2526b920 /gdb/testsuite
parentdd5ef931df8f0ea68e18cadaa1b4636cf1dbb3dc (diff)
downloadgdb-05b857720611bc2e1f9cca2573085b774181af9d.zip
gdb-05b857720611bc2e1f9cca2573085b774181af9d.tar.gz
gdb-05b857720611bc2e1f9cca2573085b774181af9d.tar.bz2
gdb/fortran: Add type info of formal parameter for clang.
Additional compiler generated formal parameter exist with clang and type information for the same is added accordingly. Also few kind parameter printing are removed which is not default for clang. Note: More details about this kind parameter omission while printing can be found with similar patch commit 0a709cba00d36d490482d0e8673e323ac1e897a6 Author Alok Kumar Sharma (alokkumar.sharma@amd.com) gdb/testsuite/ChangeLog: * gdb.fortran/ptype-on-functions.exp: Add type info of formal parameter for clang. Also removed the kind parameter for clang.
Diffstat (limited to 'gdb/testsuite')
-rw-r--r--gdb/testsuite/gdb.fortran/ptype-on-functions.exp36
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 \\(:,:\\)\\)"