]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - gdb/testsuite/gdb.java/jmain.exp
PR gas/3856
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.java / jmain.exp
CommitLineData
6aba47ca 1# Copyright 2000, 2004, 2007 Free Software Foundation, Inc.
11422c86
AC
2
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 2 of the License, or
6# (at your option) any later version.
7#
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.
12#
13# You should have received a copy of the GNU General Public License
14# along with this program; if not, write to the Free Software
15# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
16
17# This file was based on jmisc.exp which in turn was written by
18# Anthony Green. (green@redhat.com)
19
20if $tracelevel then {
21 strace $tracelevel
22}
23
24load_lib "java.exp"
25
147d6f8f
NS
26if { [skip_java_tests] } { continue }
27
11422c86
AC
28set testfile "jmain"
29set srcfile ${srcdir}/$subdir/${testfile}.java
30set binfile ${objdir}/${subdir}/${testfile}
147d6f8f
NS
31if {[compile_java_from_source ${srcfile} ${binfile} "-g"] != ""} {
32 continue
11422c86
AC
33}
34
35set prms_id 0
36set bug_id 0
37
38# Start with a fresh gdb.
39
40gdb_exit
41gdb_start
42gdb_reinitialize_dir $srcdir/$subdir
43
44gdb_test "set print sevenbit-strings" ".*"
45
46# Check that plain old "main" works. The load should both set the
47# language to java and (since --main=jmain), some how set the scope to
48# jmain's main.
49
50# Where the breakpoint should always land
51
935c2760 52set bpmain "Breakpoint .* file .*jmain.java, line 5\."
11422c86
AC
53
54gdb_load "${binfile}"
55setup_kfail *-*-* java/1567
56gdb_test "break main" "${bpmain}"
57
58# Check that an unqualified "main" works.
59
60
61gdb_load "${binfile}"
62setup_kfail *-*-* java/1565
63gdb_test "break jmain.main" "${bpmain}"
64
65# Check that a fully qualified "main" works.
66gdb_load "${binfile}"
935c2760 67setup_xfail *-*-* gcc/16439
11422c86 68gdb_test "break \'${testfile}.main(java.lang.String\[\])\'" "${bpmain}"