9 set binfile ${objdir}/${subdir}/${testfile}
12 remote_download host ${srcdir}/${subdir}/langs1.f
13 remote_download host ${srcdir}/${subdir}/langs2.cxx
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."
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}] {
29 gdb_reinitialize_dir $srcdir/$subdir
32 gdb_test "b langs0" {Function "langs0" not defined\.} \
33 "break on nonexistent function in langs.exp"
35 if [runto csub] then {
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.
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"
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"
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"
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"
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"
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"
78 if $noresults==1 then { return }
80 if [target_info exists use_gdb_stub] {
81 gdb_test "cont" "Breakpoint .*exit.*" "continue to exit in langs.exp"
83 gdb_test "cont" "Program exited normally\\." \
84 "continue to exit in langs.exp"