]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gdb/testsuite/gdb.mi/mi-vla-fortran.exp
Fortran: Testsuite, fix differences in type naming.
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.mi / mi-vla-fortran.exp
index 11ac532a62155559082358c84dfe89d87c758d61..bee6ebe156edf713757ca8d2c7185823984a0ed5 100644 (file)
@@ -17,6 +17,7 @@
 # Array (VLA).
 
 load_lib mi-support.exp
+load_lib fortran.exp
 set MIFLAGS "-i=mi"
 
 gdb_exit
@@ -32,6 +33,10 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable \
      return -1
 }
 
+# Depending on the compiler being used,
+# the type names can be printed differently.
+set real [fortran_real4]
+
 mi_delete_breakpoints
 mi_gdb_reinitialize_dir $srcdir/$subdir
 mi_gdb_load ${binfile}
@@ -58,7 +63,7 @@ mi_gdb_test "503-var-evaluate-expression vla1_not_allocated" \
   "503\\^done,value=\"\\\[0\\\]\"" \
   "eval variable vla1_not_allocated"
 mi_list_array_varobj_children_with_index "vla1_not_allocated" "0" "1" \
-    "real\\\(kind=4\\\)" "get children of vla1_not_allocated"
+    "$real" "get children of vla1_not_allocated"
 
 
 
@@ -72,10 +77,10 @@ mi_expect_stop "breakpoint-hit" "vla" "" ".*vla.f90" "$bp_lineno" \
 mi_gdb_test "510-data-evaluate-expression vla1" \
   "510\\^done,value=\"\\(.*\\)\"" "evaluate allocated vla"
 
-mi_create_varobj_checked vla1_allocated vla1 "real\\\(kind=4\\\) \\\(5\\\)" \
+mi_create_varobj_checked vla1_allocated vla1 "$real \\\(5\\\)" \
   "create local variable vla1_allocated"
 mi_gdb_test "511-var-info-type vla1_allocated" \
-  "511\\^done,type=\"real\\\(kind=4\\\) \\\(5\\\)\"" \
+  "511\\^done,type=\"$real \\\(5\\\)\"" \
   "info type variable vla1_allocated"
 mi_gdb_test "512-var-show-format vla1_allocated" \
   "512\\^done,format=\"natural\"" \
@@ -84,7 +89,7 @@ mi_gdb_test "513-var-evaluate-expression vla1_allocated" \
   "513\\^done,value=\"\\\[5\\\]\"" \
   "eval variable vla1_allocated"
 mi_list_array_varobj_children_with_index "vla1_allocated" "5" "1" \
-    "real\\\(kind=4\\\)" "get children of vla1_allocated"
+    "$real" "get children of vla1_allocated"
 
 
 set bp_lineno [gdb_get_line_number "vla1-filled"]
@@ -153,7 +158,7 @@ gdb_expect {
            "583\\^done,value=\"\\\[0\\\]\"" \
            "eval variable pvla2_not_associated"
        mi_list_array_varobj_children_with_index "pvla2_not_associated" "0" "1" \
-           "real\\\(kind=4\\\)" "get children of pvla2_not_associated"
+           "$real" "get children of pvla2_not_associated"
     }
     -re "580\\^error,msg=\"value contents too large \\(\[0-9\]+ bytes\\).*${mi_gdb_prompt}$" {
        # Undefined behaviour in gfortran.
@@ -179,9 +184,9 @@ mi_gdb_test "590-data-evaluate-expression pvla2" \
   "evaluate associated vla"
 
 mi_create_varobj_checked pvla2_associated pvla2 \
-  "real\\\(kind=4\\\) \\\(5,2\\\)" "create local variable pvla2_associated"
+  "$real \\\(5,2\\\)" "create local variable pvla2_associated"
 mi_gdb_test "591-var-info-type pvla2_associated" \
-  "591\\^done,type=\"real\\\(kind=4\\\) \\\(5,2\\\)\"" \
+  "591\\^done,type=\"$real \\\(5,2\\\)\"" \
   "info type variable pvla2_associated"
 mi_gdb_test "592-var-show-format pvla2_associated" \
   "592\\^done,format=\"natural\"" \