1 # Copyright 2008, 2009, 2010 Free Software Foundation, Inc.
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 3 of the License, or
6 # (at your option) any later version.
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with this program. If not, see <http://www.gnu.org/licenses/>.
22 set srcfile ${testfile}.c
23 set binfile ${objdir}/${subdir}/${testfile}
24 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
25 untested "Couldn't compile test program"
33 gdb_reinitialize_dir $srcdir/$subdir
36 # Do not run the inferior as the purpose of this testcase is to test
37 # the behavior of the "set language" command when there is no inferior.
39 # Check the language after the binary has been loaded. It should be
40 # "auto; currently c".
41 gdb_test "show lang" \
42 "The current source language is \"auto; currently c\"\\." \
43 "show lang after loading binary"
45 # Now, switch the language to a specific language, instead of leaving it
47 gdb_test "set lang ada" \
49 "forcing the language to ada"
51 # Verify that the language is now "ada".
52 gdb_test "show lang" \
53 "The current source language is \"ada\"\\." \
54 "show lang after switching language to ada"
56 # Then, switch back to auto...
57 gdb_test "set lang auto" \
59 "switching the language back to auto"
61 # ... And verify that the language mode is back to auto *and* that
62 # the selected language is C.
64 gdb_test "show lang" \
65 "The current source language is \"auto; currently c\"\\." \
66 "show lang after having switched back to auto"