]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - gdb/testsuite/gdb.base/langs.exp
This commit was generated by cvs2svn to track changes on a CVS vendor
[thirdparty/binutils-gdb.git] / gdb / testsuite / gdb.base / langs.exp
1 if $tracelevel then {
2 strace $tracelevel
3 }
4
5 set prms_id 0
6 set bug_id 0
7
8 set testfile langs
9 set binfile ${objdir}/${subdir}/${testfile}
10
11 if [is_remote host] {
12 remote_download host ${srcdir}/${subdir}/langs1.f
13 remote_download host ${srcdir}/${subdir}/langs2.cxx
14 }
15
16 if { [gdb_compile "${srcdir}/${subdir}/langs0.c ${srcdir}/${subdir}/langs1.c ${srcdir}/${subdir}/langs2.c" "${binfile}" executable {debug}] != "" } {
17 perror "Couldn't link langs."
18 return -1
19 }
20
21 # Create and source the file that provides information about the compiler
22 # used to compile the test case.
23 if [get_compiler_info ${binfile}] {
24 return -1;
25 }
26
27 gdb_exit
28 gdb_start
29 gdb_reinitialize_dir $srcdir/$subdir
30 gdb_load $binfile
31
32 gdb_test "b langs0" {Function "langs0" not defined\.} \
33 "break on nonexistent function in langs.exp"
34
35 if [runto csub] then {
36 global noresults
37
38 gdb_test "show language" "currently c\".*" \
39 "show language at csub in langs.exp"
40 # On some machines, foo doesn't get demangled because the N_SOL for
41 # langs2.cxx is seen only after the function stab for foo. So
42 # the following regexps are kludged to accept foo__Fi as well as foo,
43 # even though only the latter is correct. I haven't tried to xfail it
44 # because it depends on details of the compiler.
45
46 if {!$gcc_compiled} then { setup_xfail "hppa*-*-hpux*" }
47 gdb_test "bt" "#0.*csub.*#1.*(foo|foo__Fi) \\(.*#2.*cppsub_ .*#3.*fsub.*#4.*langs0__2do \\(.*#5 \[0-9a-fx\]* in main.*" "backtrace in langs.exp"
48
49 if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
50 gdb_test "up" ".* in (foo|foo__Fi) .* at langs2\\.cxx.*return csub \\(.*" \
51 "up to foo in langs.exp"
52 gdb_test "show language" "currently c\\+\\+.*" \
53 "show language at foo in langs.exp"
54
55 if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
56 gdb_test "up" ".* in cppsub_ .* at langs2\\.cxx.*return foo \\(.*" \
57 "up to cppsub_ in langs.exp"
58 gdb_test "show language" "currently c\\+\\+.*" \
59 "show language at cppsub_ in langs.exp"
60
61 if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" }
62 gdb_test "up" ".* in fsub.* at langs1\\.f.*return \\(cppsub .*" \
63 "up to fsub in langs.exp"
64 gdb_test "show language" "currently fortran.*" \
65 "show language at fsub in langs.exp"
66
67 if {!$gcc_compiled} then { setup_xfail "hppa*-*-hpux*" }
68 gdb_test "up" ".* in langs0__2do .* at .*langs0\\.c.*return fsub.*" \
69 "up to langs0__2do in langs.exp"
70 gdb_test "show language" "currently c\".*" \
71 "show language at langs0__2do in langs.exp"
72
73 gdb_test "up" ".* in main .* at .*langs0\\.c.*if \\(langs0__2do \\(.*" \
74 "up to main in langs.exp"
75 gdb_test "show language" "currently c\".*" \
76 "show language at main in langs.exp"
77
78 if $noresults==1 then { return }
79
80 if [target_info exists use_gdb_stub] {
81 gdb_test "cont" "Breakpoint .*exit.*" "continue to exit in langs.exp"
82 } else {
83 gdb_test "cont" "Program exited normally\\." \
84 "continue to exit in langs.exp"
85 }
86 }
87
88 return 0