diff options
Diffstat (limited to 'gdb/testsuite/gdb.base/langs.exp')
-rw-r--r-- | gdb/testsuite/gdb.base/langs.exp | 41 |
1 files changed, 30 insertions, 11 deletions
diff --git a/gdb/testsuite/gdb.base/langs.exp b/gdb/testsuite/gdb.base/langs.exp index 7ac954b..8671e38 100644 --- a/gdb/testsuite/gdb.base/langs.exp +++ b/gdb/testsuite/gdb.base/langs.exp @@ -5,11 +5,29 @@ if $tracelevel then { set prms_id 0 set bug_id 0 -set binfile $objdir/$subdir/langs +set testfile langs +set binfile ${objdir}/${subdir}/${testfile} +if { [compile "${srcdir}/${subdir}/langs0.c -g -c -o ${binfile}0.o "] != "" } { + perror "Couldn't compile langs0.c to object" + return -1 +} +if { [compile "${srcdir}/${subdir}/langs1.c -g -c -o ${binfile}1.o "] != "" } { + perror "Couldn't compile langs1.c to object" + return -1 +} +if { [compile "${srcdir}/${subdir}/langs2.c -g -c -o ${binfile}2.o "] != "" } { + perror "Couldn't compile langs2.c to object" + return -1 +} +if { [compile "${binfile}0.o ${binfile}1.o ${binfile}2.o -o ${binfile}"] != "" } { + perror "Couldn't link langs." + return -1 +} -if ![file exists $binfile] then { - perror "$binfile does not exist." - return 0 +execute_anywhere "rm -f ${binfile}.ci" +if { [compile "-E ${srcdir}/${subdir}/compiler.c > ${binfile}.ci"] != "" } { + perror "Couldn't make ${testfile}.ci file" + return -1 } gdb_exit @@ -17,12 +35,14 @@ gdb_start gdb_reinitialize_dir $srcdir/$subdir gdb_load $binfile -source gdb.base/langs0.ci +source ${binfile}.ci gdb_test "b langs0" {Function "langs0" not defined\.} \ "break on nonexistent function in langs.exp" if [runto csub] then { + global noresults + gdb_test "show language" "currently c\".*" \ "show language at csub in langs.exp" # On some machines, foo doesn't get demangled because the N_SOL for @@ -30,32 +50,29 @@ if [runto csub] then { # the following regexps are kludged to accept foo__Fi as well as foo, # even though only the latter is correct. I haven't tried to xfail it # because it depends on details of the compiler. + + if {!$gcc_compiled} then { setup_xfail "hppa*-*-hpux*" } 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" if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" } - setup_xfail "i*86-*-sysv4*" gdb_test "up" ".* in (foo|foo__Fi) .* at langs2\\.cxx.*return csub \\(.*" \ "up to foo in langs.exp" - setup_xfail "i*86-*-sysv4*" gdb_test "show language" "currently c\\+\\+.*" \ "show language at foo in langs.exp" - setup_xfail "i*86-*-sysv4*" if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" } gdb_test "up" ".* in cppsub_ .* at langs2\\.cxx.*return foo \\(.*" \ "up to cppsub_ in langs.exp" - setup_xfail "i*86-*-sysv4*" gdb_test "show language" "currently c\\+\\+.*" \ "show language at cppsub_ in langs.exp" - setup_xfail "i*86-*-sysv4*" if {!$gcc_compiled} then { setup_xfail "rs6000-*-*" } gdb_test "up" ".* in fsub.* at langs1\\.f.*return \\(cppsub .*" \ "up to fsub in langs.exp" - setup_xfail "i*86-*-sysv4*" gdb_test "show language" "currently fortran.*" \ "show language at fsub in langs.exp" + if {!$gcc_compiled} then { setup_xfail "hppa*-*-hpux*" } gdb_test "up" ".* in langs0__2do .* at .*langs0\\.c.*return fsub.*" \ "up to langs0__2do in langs.exp" gdb_test "show language" "currently c\".*" \ @@ -66,6 +83,8 @@ if [runto csub] then { gdb_test "show language" "currently c\".*" \ "show language at main in langs.exp" + if $noresults==1 then { return } + gdb_test "cont" "Program exited normally\\." \ "continue to exit in langs.exp" } |