-# Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+# Copyright (C) 1997-2013 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
-# the Free Software Foundation; either version 2 of the License, or
+# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
-#
+#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
-#
+#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# Please email any bugs, comments, and/or additions to this file to:
-# bug-gdb@prep.ai.mit.edu
-if $tracelevel then {
- strace $tracelevel
-}
-
-set prms_id 0
-set bug_id 0
-
-set testfile langs
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile langs0.c langs1.c langs2.c
if [is_remote host] {
remote_download host ${srcdir}/${subdir}/langs1.f
}
-if { [gdb_compile "${srcdir}/${subdir}/langs0.c" "${binfile}0.o" object {debug}] != "" } {
- gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
-}
-
-if { [gdb_compile "${srcdir}/${subdir}/langs1.c" "${binfile}1.o" object {debug}] != "" } {
- gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
-}
-
-if { [gdb_compile "${srcdir}/${subdir}/langs2.c" "${binfile}2.o" object {debug}] != "" } {
- gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
-}
-
-if { [gdb_compile "${binfile}0.o ${binfile}1.o ${binfile}2.o" ${binfile} executable {debug}] != "" } {
- gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+if {[prepare_for_testing ${testfile}.exp ${testfile} \
+ [list $srcfile $srcfile2 $srcfile3] {debug}]} {
+ return -1
}
set oldtimeout $timeout
# Create and source the file that provides information about the compiler
# used to compile the test case.
-if [get_compiler_info ${binfile}] {
- return -1;
+if [get_compiler_info] {
+ return -1
}
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load $binfile
+gdb_test_multiple "b langs0" "break on nonexistent function in langs.exp" {
+ -re "Function \"langs0\" not defined\..*Make breakpoint pending on future shared library load.*y or .n.. $" {
-gdb_test "b langs0" "Function \"langs0\" not defined\.|Breakpoint .* (deferred).*" \
- "break on nonexistent function in langs.exp"
+ gdb_test "n" "" "break on nonexistent function in langs.exp"
+ }
+ -re "Breakpoint .* (deferred).*$gdb_prompt $" {
+ pass "break on nonexistent function in langs.exp"
+ }
+}
if {$hp_aCC_compiler} {
set isfixed 1
if [target_info exists gdb,noresults] { return }
- if [target_info exists use_gdb_stub] {
- gdb_breakpoint "exit"
- gdb_test "cont" "Breakpoint .*exit.*" "continue to exit in langs.exp"
- } else {
- gdb_test "cont" "Program exited normally\\..*" \
- "continue to exit in langs.exp"
- }
+ gdb_continue_to_end "langs.exp"
+}
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load $binfile
+
+# Try exercising the "minimal" language a bit...
+
+if [runto csub] then {
+ gdb_test "set lang minimal" \
+ "Warning: the current language does not match this frame." \
+ "set lang to minimal"
+
+ gdb_test "print x" " = 5000" "print parameter value"
}
set timeout $oldtimeout