Fix more cases of improper test names
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / float.exp
index e0308eb095a62d727441201c0b75df8310a04636..7ab30c925f03f22c60ac729e907f11d6167faacf 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 2003, 2007, 2008 Free Software Foundation, Inc.
+# Copyright 2003-2016 Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 
 # This file is part of the gdb testsuite.
 
-if $tracelevel {
-    strace $tracelevel
-}
-
 #
 # Test floating-point related functionality.
 #
 
-set prms_id 0
-set bug_id 0
 
-set testfile "run"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
-if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
-    untested float.exp
+if { [prepare_for_testing "failed to prepare" float float.c] } {
     return -1
 }
 
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
-
 # Set it up at a breakpoint so we have its registers.
 
 if ![runto_main] then {
@@ -51,15 +36,20 @@ if ![runto_main] then {
 
 # Test "info float".
 
-if { [istarget "alpha*-*-*"] } then {
+if { [is_aarch64_target] } then {
+    gdb_test "info float" "d0.*d1.*d31.*s0.*s1.*s31.*" "info float"
+} elseif { [istarget "alpha*-*-*"] } then {
     gdb_test "info float" "f0.*" "info float"
-} elseif { [istarget "arm*-*-*"] || \
-       [istarget "xscale*-*-*"] || \
-       [istarget "strongarm*-*-*"] } then {
+} elseif { [is_aarch32_target] } then {
     gdb_test_multiple "info float" "info float" {
        -re "Software FPU type.*mask:.*flags:.*$gdb_prompt $" {
            pass "info float (FPA)"
        }
+       -re "fpscr.*s0.*s1.*s31.*$gdb_prompt $" {
+           # Only check for single precision; d0 might be a vector register
+           # if we have NEON.
+           pass "info float (VFP)"
+       }
         -re "No floating.point info available for this processor.*" {
             pass "info float (without FPU)"
        }
@@ -78,7 +68,23 @@ if { [istarget "alpha*-*-*"] } then {
        }
     }
 } elseif [istarget "mips*-*-*"] then {
-    gdb_test "info float" "f0:.*flt:.*dbl:.*" "info float"
+    gdb_test_multiple "info float" "info float" {
+       -re "fpu type: none / unused\r\n$gdb_prompt $" {
+             pass "info float (without FPU)"
+         }
+       -re "fpu type:.*cause.*mask.*flags.*round.*flush.*f0:.*flt:.*dbl:.*$gdb_prompt $" {
+             pass "info float (with FPU)"
+         }
+    }
+} elseif [istarget "nds32*-*-*"] then {
+    gdb_test_multiple "info float" "info_float" {
+        -re "fd0.*fd3.*$gdb_prompt $" {
+            pass "info float (with FPU)"
+       }
+        -re "No floating.point info available for this processor.*" {
+            pass "info float (without FPU)"
+       }
+    }
 } elseif [istarget "powerpc*-*-*"] then {
     gdb_test_multiple "info float" "info_float" {
         -re "f0.*f1.*f31.*fpscr.*$gdb_prompt $" {
@@ -107,3 +113,6 @@ if { [istarget "alpha*-*-*"] } then {
 } else {
     gdb_test "info float" "No floating.point info available for this processor." "info float (unknown target)"
 }
+
+gdb_test "step"
+gdb_test "finish" "Value returned is .* = (inf|nan).*"
This page took 0.027342 seconds and 4 git commands to generate.