# This testcase is part of GDB, the GNU debugger.
-# Copyright 1992-2016 Free Software Foundation, Inc.
+# Copyright 1992-2017 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
standard_testfile .c
if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
- untested printcmds.exp
+ untested "failed to compile"
return -1
}
test_print_reject "p 1.1ll"
}
+# Regression test for PR gdb/21675
+proc test_radices {} {
+ gdb_test "print/o 16777211" " = 077777773"
+ gdb_test "print/d 1.5" " = 1"
+ gdb_test "print/u 1.5" " = 1"
+
+ gdb_test "print/u (char) -1" " = 255"
+ gdb_test "print/d (unsigned char) -1" " = -1"
+}
+
proc test_print_all_chars {} {
global gdb_prompt
gdb_test_no_output "set print elements 50"
if [target_info exists gdb,cannot_call_functions] {
- unsupported "This target can not call functions"
+ unsupported "this target can not call functions"
return
}
proc test_print_array_constants {} {
if [target_info exists gdb,cannot_call_functions] {
- unsupported "This target can not call functions"
+ unsupported "this target can not call functions"
return
}
gdb_test "print \$cvar = \"abc\"" " = \"abc\""
gdb_test "print sizeof (\$cvar)" " = 4"
+# GDB used to complete the explicit location options even when
+# printing expressions.
+gdb_test_no_output "complete p -function"
+gdb_test_no_output "complete p -line"
+gdb_test_no_output "complete p -source"
+
gdb_file_cmd ${binfile}
gdb_test "print \$pc" "No registers\\." "print \$pc (with file)"
gdb_load ${binfile}
if ![runto_main] then {
- fail "Can't run to main"
+ fail "can't run to main"
return 0
}
test_printf_with_dfp
test_print_symbol
test_repeat_bytes
+test_radices