return
}
-if { [gdb_skip_float_test] } {
- verbose "Skipping ${gdb_test_file_name}."
- return
-}
+require allow_float_test
standard_testfile
if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} {debug quiet}] } {
return
}
-if { [gdb_skip_float_test] } {
- untested "no floating point support"
- return
-}
+require allow_float_test
standard_testfile
# Create and source the file that provides information about the compiler
# used to compile the test case.
-set skip_float_test [gdb_skip_float_test]
+set allow_float_test [allow_float_test]
if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
return -1
#call print_double_array(double_array)
-if {!$skip_float_test && \
+if {$allow_float_test && \
![gdb_skip_stdio_test "print print_double_array(double_array)"] } {
gdb_test_stdio "print print_double_array(double_array)" \
"Temporary breakpoint.* file .*$srcfile, line $stop_line.*" \
"tbreakpoint at tbreak3"
-if {!$skip_float_test && \
+if {$allow_float_test && \
![gdb_skip_stdio_test "continuing to tbreak3"] } {
gdb_test_stdio "continue" \
}
#call print_double_array(array_d)
-if {!$skip_float_test && \
+if {$allow_float_test && \
![gdb_skip_stdio_test "print print_double_array(array_d)"] } {
gdb_test_stdio "print print_double_array(array_d)" \
"Temporary breakpoint.* file .*$srcfile, line $stop_line.*" \
"tbreakpoint at tbreak4"
-if {!$skip_float_test && \
+if {$allow_float_test && \
![gdb_skip_stdio_test "continuing to tbreak4"] } {
gdb_test_stdio "continue" \
# *flags, *flags_combo, *three_char, *five_char,
# *int_char_combo, *d1, *d2, *d3, *f1, *f2, *f3)
-if {!$skip_float_test && \
+if {$allow_float_test && \
![gdb_skip_stdio_test "print print_small_structs(...)"] } {
gdb_test_stdio "print print_small_structs(*struct1, *struct2, *struct3, *struct4, *flags, *flags_combo, *three_char, *five_char, *int_char_combo, *d1, *d2, *d3, *f1, *f2, *f3)" \
[multi_line \
#call print_ten_doubles(123.456, 123.456, -0.12, -1.23, 343434.8, 89.098,
# 3.14, -5678.12345, -0.11111111, 216.97065)
-if {!$skip_float_test && \
+if {$allow_float_test && \
![gdb_skip_stdio_test "print print_ten_doubles(...)"]} {
gdb_test_stdio "print print_ten_doubles(123.456, 123.456, -0.12, -1.23, 343434.8, 89.098, 3.14, -5678.12345, -0.11111111, 216.97065)" \
[multi_line \
# The short match case below handles cases where a buffer
# overflows or something, and expect can't deal with the full
# line. Perhaps a more elegant solution exists... -sts 1999-08-17
-if {!$skip_float_test} {
+if {$allow_float_test} {
gdb_test_multiple "continue" "step into print_long_arg_list" {
-re ".*print_long_arg_list \\(a=22.25, b=33.375, c=0, d=-25, e=100, f=2345, struct1=\{value = 6, head = 0\}, struct2=\{value = 10, head = 0\}, struct3=\{value = 12, head = 0\}, struct4=\{value = 14, head = 0\}, flags=\{alpha = 1, beta = 0, gamma = 1, delta = 0, epsilon = 1, omega = 0\}, flags_combo=\{alpha = 1, beta = 0, ch1 = 121 \'y\', gamma = 1, delta = 0, ch2 = 110 \'n\', epsilon = 1, omega = 0\}, three_char=\{ch1 = 97 \'a\', ch2 = 98 \'b\', ch3 = 99 \'c\'\}, five_char=\{ch1 = 108 \'l\', ch2 = 109 \'m\', ch3 = 110 \'n\', ch4 = 111 \'o\', ch5 = 112 \'p\'\}, int_char_combo=\{int1 = 123, ch1 = 122 \'z\'\}, d1=\{double1 = 10.5\}, d2=\{double1 = -3.375\}, d3=\{double1 = 675.09375\}, f1=\{float1 = 45.2340012, float2 = 43.5999985\}, f2=\{float1 = 78.0100021, float2 = 122.099998\}, f3=\{float1 = -1232.34497, float2 = -199.210007\}\\) at .*${srcfile}:$stop_line\[\r\n\]+$stop_line\[ \t\]+printf\\(\"double :.*\", a\\);.*$gdb_prompt $" {
pass "step into print_long_arg_list"
# flags_combo, three_char, five_char, int_char_combo,
# d1, d2, d3, f1, f2, f3)
-if {!$skip_float_test && \
+if {$allow_float_test && \
![gdb_skip_stdio_test "print_small_structs from print_long_arg_list"] } {
# On 32-bit SPARC, some of the args are passed by ref, others by
#call print_long_arg_list(a, b, c, d, e, f, *struct1, *struct2, *struct3, *struct4, *flags, *flags_combo, *three_char, *five_char, *int_char_combo, *d1, *d2, *d3, *f1, *f2, *f3)
-if {!$skip_float_test && \
+if {$allow_float_test && \
![gdb_skip_stdio_test "print print_long_arg_list"] } {
gdb_test_stdio "print print_long_arg_list(a, b, c, d, e, f, *struct1, *struct2, *struct3, *struct4, *flags, *flags_combo, *three_char, *five_char, *int_char_combo, *d1, *d2, *d3, *f1, *f2, *f3)" \
return
}
-set skip_float_test [gdb_skip_float_test]
+set allow_float_test [allow_float_test]
# Start with a fresh gdb.
".\[0-9\]+ = \\{next_index = \\{1, 2, 3, 4, 5, 6, 7, 8, 9, 10\\}, values = \\{4, 6, 8, 10, 12, 14, 16, 18, 20, 22\\}, head = 0\\}"
}
-if {!$skip_float_test && \
+if {$allow_float_test && \
![gdb_skip_stdio_test "print print_one_double(*d1)"] } {
print_struct_call "print_one_double(*d1)" \
".*Contents of one_double_t:\[ \r\n\]+1\\.111110\[ \r\n\]+" \
".\[0-9\]+ = \\{double1 = 1\\.111\[0-9\]*\\}"
}
-if {!$skip_float_test && \
+if {$allow_float_test && \
![gdb_skip_stdio_test "print print_two_floats(*f3)"] } {
print_struct_call "print_two_floats(*f3)" \
".*Contents of two_floats_t:\[ \r\n\]+-2\\.345000\[ \t]+1\\.000000\[ \r\n\]+" \
standard_testfile .c
-set skip_float_test [gdb_skip_float_test]
+set allow_float_test [allow_float_test]
# Compile a variant of scalars.c using TYPE to specify the type of the
# parameter and return-type. Run the compiled program up to "main".
# Approx size: 8, 16, ...
test tll
-if {!$skip_float_test} {
+if {$allow_float_test} {
# Approx size: 4, 8, ...
test tf
return
}
-set skip_float_test [gdb_skip_float_test]
+set allow_float_test [allow_float_test]
# FIXME: Before calling this proc, we should probably verify that
# we can call inferior functions and get a valid integral value
# (computed in the inferior) is 1 for true and 0 for false.
proc do_function_calls {prototypes} {
- global gdb_prompt skip_float_test
+ global gdb_prompt allow_float_test
# We need to up this because this can be really slow on some boards.
set timeout 60
gdb_test "p t_long_values(789,long_val2)" " = 1"
gdb_test "p t_long_values(long_val1,-321)" " = 1"
- if {!$skip_float_test} {
+ if {$allow_float_test} {
gdb_test "p t_float_values(0.0,0.0)" " = 0"
# These next four tests fail on the mn10300.
gdb_test "p t_structs_l(struct_val1)" "= 51" \
"call inferior func with struct - returns long"
- if {!$skip_float_test} {
+ if {$allow_float_test} {
gdb_test "p t_structs_f(struct_val1)" "= 2.12.*" \
"call inferior func with struct - returns float"
gdb_test "p t_structs_d(struct_val1)" "= 9.87.*" \
# This file was written by Michael Snyder (msnyder@redhat.com)
-set skip_float_test [gdb_skip_float_test]
+set allow_float_test [allow_float_test]
# re-use the program from the "return2" test.
if { [prepare_for_testing "failed to prepare" finish return2.c] } {
}
proc finish_tests { } {
- global gdb_prompt skip_float_test
+ global gdb_prompt allow_float_test
if {![runto_main]} {
return -1
finish_1 "int"
finish_1 "long"
finish_1 "long_long"
- if {!$skip_float_test} {
+ if {$allow_float_test} {
finish_1 "float"
finish_1 "double"
}
lappend compile_flags "additional_flags=-DTEST_COMPLEX"
}
-set skip_float_test [gdb_skip_float_test]
+set allow_float_test [allow_float_test]
if {[prepare_for_testing "failed to prepare" $testfile $srcfile $compile_flags]} {
return -1
integral_args
unsigned_integral_args
-if {!$skip_float_test} {
+if {$allow_float_test} {
float_and_integral_args
}
complex_integral_args
- if {!$skip_float_test} {
+ if {$allow_float_test} {
complex_float_integral_args
}
}
}
}
-if ![gdb_skip_float_test] {
+if {[allow_float_test]} {
foreach ta $float_types {
start_gdb_and_run_tests $lang $ta
}
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-set skip_float_test [gdb_skip_float_test]
+set allow_float_test [allow_float_test]
proc do_test {type} {
set typenospace [string map {{ } -} $type]
}
foreach type {{signed char} {short} {int} {long} {long long} {float} {double}} {
- if { $skip_float_test && ($type == "float" || $type == "double") } {
+ if { !$allow_float_test && ($type == "float" || $type == "double") } {
continue
}
set typenospace_dash \
return -1
}
-set skip_float_test [gdb_skip_float_test]
+set allow_float_test [allow_float_test]
proc return_tests { } {
- global gdb_prompt skip_float_test
+ global gdb_prompt allow_float_test
if {![runto func1]} { return 0 }
# is not xfailed.
setup_xfail "sparc-*-solaris2.3*" "sparc-*-solaris2.4*" "m6811-*-*"
- if {!$skip_float_test} {
+ if {$allow_float_test} {
gdb_test "p tmp3" ".* = 5.*" \
"correct value returned double test (known problem with sparc solaris)"
}
return -1
}
-set skip_float_test [gdb_skip_float_test]
+set allow_float_test [allow_float_test]
proc return_1 { type } {
global gdb_prompt
}
proc return2_tests { } {
- global gdb_prompt skip_float_test
+ global gdb_prompt allow_float_test
if {![runto_main]} {
return -1
if {![istarget "m6811-*-*"] && ![istarget "h8300*-*"]} {
return_1 "long_long"
}
- if {!$skip_float_test} {
+ if {$allow_float_test} {
return_1 "float"
if {![istarget "m6811-*-*"]} {
return_1 "double"
# Regex matching any value of `char' type like: a = 65 'A'
set anychar_re {-?[0-9]{1,3} '(.|\\([0-7]{3}|[a-z]|\\|'))'}
-set skip_float_test [gdb_skip_float_test]
+set allow_float_test [allow_float_test]
# Compile a variant of structs.c using TYPES to specify the type of
# the first N struct elements (the remaining elements take the type of
# Approx size: 8, 16, ...
test { tll } {1 2} {1}
-if { !$skip_float_test } {
+if { $allow_float_test } {
# Approx size: 4, 8, ...
test { tf } {1 3} {1 2}
# Approx size: 8+1=9, 10, ...
test { tll tc } {2} {}
-if { !$skip_float_test } {
+if { $allow_float_test } {
# Approx size: 4+1=5, 6, ...
test { tf tc } {2 6} {2}
# Approx size: (1+7)+8=16, 24, ...
test { tc tll } {2} {}
-if { !$skip_float_test } {
+if { $allow_float_test } {
# Approx size: (1+3)+4=8, 12, ...
test { tc tf } {2 4} {}
standard_testfile .c
-set skip_float_test [gdb_skip_float_test]
+set allow_float_test [allow_float_test]
set additional_flags {debug}
if [support_complex_tests] {
".\[0-9\]+ = 3" \
"print find_max2(3,1,2,3)"
-if {!$skip_float_test} {
+if {$allow_float_test} {
gdb_test_stdio "print find_max_double(5,1.0,17.0,2.0,3.0,4.0)" \
"find_max\\(.*\\) returns 17\\.000000\[ \r\n\]+" \
".\[0-9\]+ = 17" \
gdb_caching_proc support_complex_tests {
- if { [gdb_skip_float_test] } {
+ if { ![allow_float_test] } {
# If floating point is not supported, _Complex is not
# supported.
return 0
return 0
}
-# Return true if a test should be skipped due to lack of floating
+# Return false if a test should be skipped due to lack of floating
# point support or GDB can't fetch the contents from floating point
# registers.
-gdb_caching_proc gdb_skip_float_test {
+gdb_caching_proc allow_float_test {
if [target_info exists gdb,skip_float_tests] {
- return 1
+ return 0
}
# There is an ARM kernel ptrace bug that hardware VFP registers
if {![string match "" $lines]} {
verbose "testfile compilation failed, returning 1" 2
- return 0
+ return 1
}
# No error message, compilation succeeded so now run it via gdb.
# Run the test up to 5 times to detect whether ptrace can
# correctly update VFP registers or not.
- set skip_vfp_test 0
+ set allow_vfp_test 1
for {set i 0} {$i < 5} {incr i} {
global gdb_prompt srcdir subdir
-re "exited normally.*$gdb_prompt $" {
# However, the exit code is 0. That means something
# wrong in setting VFP registers.
- set skip_vfp_test 1
+ set allow_vfp_test 0
break
}
}
gdb_exit
remote_file build delete $exe
- return $skip_vfp_test
+ return $allow_vfp_test
}
- return 0
+ return 1
}
# Print a message and return true if a test should be skipped