gdb/testsuite: remove use of then keyword from gdb.fortran/*.exp
[binutils-gdb.git] / gdb / testsuite / gdb.fortran / namelist.exp
index d6263e12fecced2821ffa7094a7407e752e3cd57..46f24f4797008c53507f3f56ac998abc0142679a 100644 (file)
@@ -25,9 +25,9 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug f90}]} {
     return -1
 }
 
-if ![fortran_runto_main] then {
+if {![fortran_runto_main]} {
     perror "couldn't run to main"
-    continue
+    return
 }
 
 # Depending on the compiler being used, the type names can be printed
@@ -37,7 +37,11 @@ set int [fortran_int4]
 gdb_breakpoint [gdb_get_line_number "Display namelist"]
 gdb_continue_to_breakpoint "Display namelist"
 
-if {[test_compiler_info {gcc-*}]} {
+# DW_TAG_namelist is supported starting gcc 4.9.
+set supported [expr \
+                  [test_compiler_info {gfortran-*} f90] \
+                  && [gcc_major_version {gfortran-*} f90] >= 4.9]
+if { $supported } {
     gdb_test "ptype nml" \
         "type = Type nml\r\n *$int :: a\r\n *$int :: b\r\n *End Type nml"
     gdb_test "print nml" \