diff options
Diffstat (limited to 'gdb/testsuite')
30 files changed, 142 insertions, 70 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index aa1d60b41da..15dd281334a 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,49 @@ +1999-09-08 Stan Shebs <shebs@andros.cygnus.com> + + * break.c (main): Compare a possibly-uninitialized argc with an + unlikely value that fits in 16 bits. + +1999-09-07 Stan Shebs <shebs@andros.cygnus.com> + + * gdb.base/restore.c, gdb.base/restore.exp: Use 0x7eeb instead of + 0xfeeb, don't want negative numbers if ints are 16 bits. + + * lib/gdb.exp (skip_cplus_tests): New proc. + * gdb.c++/ambiguous.exp, gdb.c++/annota2.exp, + gdb.c++/anon-union.exp, gdb.c++/classes.exp, + gdb.c++/cplusfuncs.exp, gdb.c++/ctti.exp, gdb.c++/demangle.exp, + gdb.c++/derivation.exp, gdb.c++/inherit.exp, gdb.c++/local.exp, + gdb.c++/member-ptr.exp, gdb.c++/method.exp, gdb.c++/misc.exp, + gdb.c++/overload.exp, gdb.c++/ovldbreak.exp, + gdb.c++/ref-types.exp, gdb.c++/templates.exp, gdb.c++/userdef.exp, + gdb.c++/virtfunc.exp: Use it to skip over C++ tests. + + * gdb.c++/cplusfuncs.exp: Use get_compiler_info consistently. + +Fri Sep 3 15:37:12 1999 Kevin Buettner <kevinb@cygnus.com> + + * gdb.base/corefile.exp (up): Allow a parameter to appear + in the frame that we're going up to. + + From Jim Blandy <jimb@cygnus.com>: + + * gdb.base/default.exp (info float): Expect some output now. + + * gdb.base/callfuncs.exp (do_function_calls): We no longer expect + returning floating-point values to fail on the x86. + * gdb.base/callfwmall.exp (do_function_calls): Same. + + * gdb.base/list.exp (test_listsize): Correct expectations for + listing line 1 with listsize 2. Also, listing a single line + works now, as does listing three lines. [Kevin's note: There + were a number of other cases fixed too where the expectations + differed...] + +1999-09-02 Stan Shebs <shebs@andros.cygnus.com> + + * gdb.base/selftest.exp: Add case for when version prints as + constant string instead of char pointer. + 1999-08-25 Stan Shebs <shebs@andros.cygnus.com> * gdb.base/ending-run.exp: Add Solaris case for what happens when diff --git a/gdb/testsuite/gdb.base/break.c b/gdb/testsuite/gdb.base/break.c index 6acbf9b416c..7e5fb8e23f6 100644 --- a/gdb/testsuite/gdb.base/break.c +++ b/gdb/testsuite/gdb.base/break.c @@ -72,7 +72,7 @@ char *argv[], **envp; set_debug_traps(); breakpoint(); #endif - if (argc == 123456) { + if (argc == 12345) { /* an unlikely value < 2^16, in case uninited */ fprintf (stderr, "usage: factorial <number>\n"); return 1; } diff --git a/gdb/testsuite/gdb.base/callfuncs.exp b/gdb/testsuite/gdb.base/callfuncs.exp index 1ce9683316a..397a255bd99 100644 --- a/gdb/testsuite/gdb.base/callfuncs.exp +++ b/gdb/testsuite/gdb.base/callfuncs.exp @@ -229,10 +229,8 @@ proc do_function_calls {} { "call inferior func with struct - returns int" gdb_test "p t_structs_l(struct_val1)" "= 51" \ "call inferior func with struct - returns long" - setup_xfail "i*86-*-*" gdb_test "p t_structs_f(struct_val1)" "= 2.12.*" \ "call inferior func with struct - returns float" - setup_xfail "i*86-*-*" gdb_test "p t_structs_d(struct_val1)" "= 9.87.*" \ "call inferior func with struct - returns double" gdb_test "p t_structs_a(struct_val1)" "= (.unsigned char .. )?\"foo\"" \ diff --git a/gdb/testsuite/gdb.base/callfwmall.exp b/gdb/testsuite/gdb.base/callfwmall.exp index 7d7cf78adc0..16851e68d07 100644 --- a/gdb/testsuite/gdb.base/callfwmall.exp +++ b/gdb/testsuite/gdb.base/callfwmall.exp @@ -236,10 +236,8 @@ proc do_function_calls {} { "call inferior func with struct - returns int" gdb_test "p t_structs_l(struct_val1)" "= 51" \ "call inferior func with struct - returns long" - setup_xfail "i*86-*-*" gdb_test "p t_structs_f(struct_val1)" "= 2.12.*" \ "call inferior func with struct - returns float" - setup_xfail "i*86-*-*" gdb_test "p t_structs_d(struct_val1)" "= 9.87.*" \ "call inferior func with struct - returns double" gdb_test "p t_structs_a(struct_val1)" "= (.unsigned char .. )?\"foo\"" \ diff --git a/gdb/testsuite/gdb.base/corefile.exp b/gdb/testsuite/gdb.base/corefile.exp index 32f3f56b8ac..f998f886659 100644 --- a/gdb/testsuite/gdb.base/corefile.exp +++ b/gdb/testsuite/gdb.base/corefile.exp @@ -189,7 +189,7 @@ gdb_test "print func2::coremaker_local" "\\\$$decimal = {0, 1, 2, 3, 4}" # file correctly. I don't think the other tests do this. gdb_test "bt" "abort.*func2.*func1.*main.*" "backtrace in corefile.exp" -gdb_test "up" "#\[0-9\]* *\[0-9xa-fH'\]* in .* \\(\\).*" "up in corefile.exp" +gdb_test "up" "#\[0-9\]* *\[0-9xa-fH'\]* in .* \\(.*\\).*" "up in corefile.exp" # Test ability to read mmap'd data diff --git a/gdb/testsuite/gdb.base/default.exp b/gdb/testsuite/gdb.base/default.exp index 528d5a99f55..f73a6d70431 100644 --- a/gdb/testsuite/gdb.base/default.exp +++ b/gdb/testsuite/gdb.base/default.exp @@ -304,6 +304,8 @@ if [istarget "arm-*-*"] then { gdb_test "info float" "Software FPU type.*mask:.*flags:.*" "info float" } elseif [istarget "strongarm-*-*"] then { gdb_test "info float" "Software FPU type.*mask:.*flags:.*" "info float" +} elseif [istarget "i\[3456\]86-*-linux-gnu"] then { + gdb_test "info float" "No registers." } else { gdb_test "info float" "No floating point info available for this processor." "info float" } diff --git a/gdb/testsuite/gdb.base/list.exp b/gdb/testsuite/gdb.base/list.exp index f319ba07c94..b9dad0a86f5 100644 --- a/gdb/testsuite/gdb.base/list.exp +++ b/gdb/testsuite/gdb.base/list.exp @@ -111,7 +111,7 @@ proc test_listsize {} { # Try just two lines if [ set_listsize 2 ] { - gdb_test "list 1" "1\[ \t\]+#include \"list0.h\"" "list line 1 with listsize 2" + gdb_test "list 1" "1\[ \t\]+#include \"list0.h\"\r\n2\[ \t\]+" "list line 1 with listsize 2" gdb_test "list 2" "1\[ \t\]+#include \"list0.h\"\r\n2\[ \t\]+" "list line 2 with listsize 2" gdb_test "list 3" "2\[ \t\]+\r\n3\[ \t\]+int main \[)(\]+" "list line 3 with listsize 2" } @@ -119,18 +119,16 @@ proc test_listsize {} { # Try small listsize > 1 that is an odd number if [ set_listsize 3 ] { - setup_xfail "*-*-*" - gdb_test "list 1" "1\[ \t\]+#include \"list0.h\"2\[ \t\]+" "list line 1 with listsize 3" + gdb_test "list 1" "1\[ \t\]+#include \"list0.h\".*3\[ \t\]+int main \[)(\]+" "list line 1 with listsize 3" gdb_test "list 2" "1\[ \t\]+#include \"list0.h\".*3\[ \t\]+int main \[)(\]+" "list line 2 with listsize 3" - gdb_test "list 3" "2\[ \t\]+\r\n3\[ \t\]+int main \[(\]+\[)\]+\r\n4\[ \t\]+\{" "list line 3 with listsize 3" } # Try small listsize > 2 that is an even number. if [ set_listsize 4 ] then { - gdb_test "list 1" "1\[ \t\]+#include \"list0.h\"\r\n2\[ \t\]+" "list line 1 with listsize 4" - gdb_test "list 2" "1\[ \t\]+#include \"list0.h\".*3\[ \t\]+int main \[)(\]+" "list line 2 with listsize 4" + gdb_test "list 1" "1\[ \t\]+#include \"list0.h\".*4\[ \t\]+\{" "list line 1 with listsize 4" + gdb_test "list 2" "1\[ \t\]+#include \"list0.h\".*4\[ \t\]+\{" "list line 2 with listsize 4" gdb_test "list 3" "1\[ \t\]+#include \"list0.h\".*4\[ \t\]+\{" "list line 3 with listsize 4" gdb_test "list 4" "2\[ \t\]+\r\n.*5\[ \t\]+int x;.*" "list line 4 with listsize 4" @@ -166,7 +164,7 @@ proc test_list_include_file {} { setup_xfail "a29k-*-udi" setup_xfail_format "DWARF 1" setup_xfail_format "COFF" - gdb_test "list list0.h:1" "1\[ \t\]+/\[*\]+ An include file .*4\[ \t\]+.*foo \(.*x.*\).*" "list line 1 in include file" + gdb_test "list list0.h:1" "1\[ \t\]+/\[*\]+ An include file .*10\[ \t\]+bar \\(x\\+\\+\\);" "list line 1 in include file" setup_xfail "a29k-*-udi" setup_xfail_format "DWARF 1" @@ -185,7 +183,7 @@ proc test_list_filename_and_number {} { send_gdb "list list0.c:1\n" gdb_expect { - -re "1\[ \t\]+#include \"list0.h\".*5\[ \t\]+int x;\r\n$gdb_prompt $" { + -re "1\[ \t\]+#include \"list0.h\".*10\[ \t]+x = 0;\r\n$gdb_prompt $" { incr testcnt } -re ".*$gdb_prompt $" { fail "list list0.c:1" ; gdb_suppress_tests } @@ -231,7 +229,7 @@ proc test_list_function {} { # in include files, which breaks this test. # SunPRO cc is the second case below, it's also correct. setup_xfail "a29k-*-udi" - gdb_test "list main" "(5\[ \t\]+int x;.*14\[ \t\]+foo \[(\]+.*\[)\]+;|1\[ \t\]+#include .*8\[ \t\]+breakpoint\[(\]\[)\]+;)" "list function in source file 1" + gdb_test "list main" "(5\[ \t\]+int x;.*14\[ \t\]+foo \[(\]+.*\[)\]+;|1\[ \t\]+#include .*10\[ \t\]+x = 0;)" "list function in source file 1" # Ultrix gdb takes the second case below; it's also correct. # SunPRO cc is the third case. @@ -398,7 +396,7 @@ proc test_list_filename_and_function {} { setup_xfail "a29k-*-udi" send_gdb "list list0.c:main\n" gdb_expect { - -re "1\[ \t\]+#include .*8\[ \t\]+breakpoint\[(\]\[)\]+;\r\n$gdb_prompt $" { + -re "1\[ \t\]+#include .*10\[ \t\]+x = 0;\r\n$gdb_prompt $" { incr testcnt } -re "5\[ \t\]+int x;.*14\[ \t\]+foo \[(\]+.*\[)\]+;\r\n$gdb_prompt $" { diff --git a/gdb/testsuite/gdb.base/restore.c b/gdb/testsuite/gdb.base/restore.c index 2469430fe1a..974e94486cc 100644 --- a/gdb/testsuite/gdb.base/restore.c +++ b/gdb/testsuite/gdb.base/restore.c @@ -65,7 +65,7 @@ (insert "int\n") (insert (caller i) " (void)\n") (insert "{\n") - (let ((last (local-chain i "0xfeeb" (caller i)))) + (let ((last (local-chain i "0x7eeb" (caller i)))) (insert " register int n;\n") (let ((j 0)) (while (<= j limit) @@ -159,7 +159,7 @@ callee5 (int n) int caller1 (void) { - register int l1 = increment (0xfeeb); /* caller1 */ + register int l1 = increment (0x7eeb); /* caller1 */ register int n; n = callee0 (l1); n = callee1 (n + l1); @@ -173,7 +173,7 @@ caller1 (void) int caller2 (void) { - register int l1 = increment (0xfeeb); /* caller2 */ + register int l1 = increment (0x7eeb); /* caller2 */ register int l2 = increment (l1); register int n; n = callee0 (l2); @@ -188,7 +188,7 @@ caller2 (void) int caller3 (void) { - register int l1 = increment (0xfeeb); /* caller3 */ + register int l1 = increment (0x7eeb); /* caller3 */ register int l2 = increment (l1); register int l3 = increment (l2); register int n; @@ -204,7 +204,7 @@ caller3 (void) int caller4 (void) { - register int l1 = increment (0xfeeb); /* caller4 */ + register int l1 = increment (0x7eeb); /* caller4 */ register int l2 = increment (l1); register int l3 = increment (l2); register int l4 = increment (l3); @@ -221,7 +221,7 @@ caller4 (void) int caller5 (void) { - register int l1 = increment (0xfeeb); /* caller5 */ + register int l1 = increment (0x7eeb); /* caller5 */ register int l2 = increment (l1); register int l3 = increment (l2); register int l4 = increment (l3); diff --git a/gdb/testsuite/gdb.base/restore.exp b/gdb/testsuite/gdb.base/restore.exp index 64b714bd1b6..8cf5035f163 100644 --- a/gdb/testsuite/gdb.base/restore.exp +++ b/gdb/testsuite/gdb.base/restore.exp @@ -80,7 +80,7 @@ proc restore_tests { } { # Check that the values of the local variables are what # they should be. for {set var 1} {$var <= $c} {incr var} { - set expected [expr 0xfeeb + $var] + set expected [expr 0x7eeb + $var] gdb_test "print l$var" " = $expected" \ "caller$c called callee$e; variable l$var restored" } diff --git a/gdb/testsuite/gdb.base/selftest.exp b/gdb/testsuite/gdb.base/selftest.exp index c0d17c815ec..72a086e63b1 100644 --- a/gdb/testsuite/gdb.base/selftest.exp +++ b/gdb/testsuite/gdb.base/selftest.exp @@ -254,8 +254,11 @@ proc test_with_self { executable } { # do we have a version number ? send_gdb "print version\n" gdb_expect { + -re ".\[0-9\]+ = .\[0-9.\]+.*$gdb_prompt $" { + pass "printed version as string" + } -re ".\[0-9\]+ = +0x.*\[0-9.\]+.*$gdb_prompt $" { - pass "printed version" + pass "printed version as pointer" } -re ".\[0-9\]+ = +.+ +0x.*\[0-9.\]+.*$gdb_prompt $" { pass "printed version with cast" diff --git a/gdb/testsuite/gdb.c++/ambiguous.exp b/gdb/testsuite/gdb.c++/ambiguous.exp index 998b47894c5..6ee60e74b00 100644 --- a/gdb/testsuite/gdb.c++/ambiguous.exp +++ b/gdb/testsuite/gdb.c++/ambiguous.exp @@ -1,4 +1,4 @@ -# Copyright (C) 1998 Free Software Foundation, Inc. +# Copyright (C) 1998, 1999 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -35,6 +35,8 @@ if $tracelevel then { set prms_id 0 set bug_id 0 +if { [skip_cplus_tests] } { continue } + set testfile "ambiguous" set srcfile ${testfile}.cc set binfile ${objdir}/${subdir}/${testfile} diff --git a/gdb/testsuite/gdb.c++/annota2.exp b/gdb/testsuite/gdb.c++/annota2.exp index 0a58cd4193d..1e25c5d382f 100644 --- a/gdb/testsuite/gdb.c++/annota2.exp +++ b/gdb/testsuite/gdb.c++/annota2.exp @@ -31,6 +31,8 @@ if $tracelevel then { set prms_id 0 set bug_id 0 +if { [skip_cplus_tests] } { continue } + set testfile "annota2" set srcfile ${testfile}.cc set binfile ${objdir}/${subdir}/${testfile} diff --git a/gdb/testsuite/gdb.c++/anon-union.exp b/gdb/testsuite/gdb.c++/anon-union.exp index 5ed924f6cb4..767ef0222ca 100644 --- a/gdb/testsuite/gdb.c++/anon-union.exp +++ b/gdb/testsuite/gdb.c++/anon-union.exp @@ -1,4 +1,5 @@ -# Copyright (C) 1998 Free Software Foundation, Inc. +# Tests for anonymous union support. +# Copyright (C) 1998, 1999 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -17,8 +18,6 @@ # Please email any bugs, comments, and/or additions to this file to: # bug-gdb@prep.ai.mit.edu -# -# Tests for anonymous union support # Written by Satish Pai <pai@apollo.hp.com> 1997-08-19 # This file is part of the gdb testsuite @@ -34,9 +33,12 @@ if $tracelevel then { set prms_id 0 set bug_id 0 +if { [skip_cplus_tests] } { continue } + set testfile "anon-union" set srcfile ${testfile}.cc set binfile ${objdir}/${subdir}/${testfile} + if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } { gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." } diff --git a/gdb/testsuite/gdb.c++/classes.exp b/gdb/testsuite/gdb.c++/classes.exp index cf6a2cd682b..91a0400d47e 100644 --- a/gdb/testsuite/gdb.c++/classes.exp +++ b/gdb/testsuite/gdb.c++/classes.exp @@ -26,10 +26,7 @@ if $tracelevel then { strace $tracelevel } - -# Check to see if we have an executable to test. If not, then either we -# haven't tried to compile one, or the compilation failed for some reason. -# In either case, just notify the user and skip the tests in this file. +if { [skip_cplus_tests] } { continue } set testfile "misc" set srcfile ${testfile}.cc @@ -42,7 +39,6 @@ if [get_compiler_info ${binfile} "c++"] { return -1 } - if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } { gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." } diff --git a/gdb/testsuite/gdb.c++/cplusfuncs.exp b/gdb/testsuite/gdb.c++/cplusfuncs.exp index 16283f387e7..d3783a308ed 100644 --- a/gdb/testsuite/gdb.c++/cplusfuncs.exp +++ b/gdb/testsuite/gdb.c++/cplusfuncs.exp @@ -1,4 +1,4 @@ -# Copyright (C) 1992, 1997 Free Software Foundation, Inc. +# Copyright (C) 1992, 1997, 1999 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -23,21 +23,20 @@ if $tracelevel then { strace $tracelevel } -# Check to see if we have an executable to test. If not, then either we -# haven't tried to compile one, or the compilation failed for some reason. -# In either case, just notify the user and skip the tests in this file. +if { [skip_cplus_tests] } { continue } set testfile "cplusfuncs" set srcfile ${testfile}.cc set binfile ${objdir}/${subdir}/${testfile} -if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } { - gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." -} -if {[get_compiler_info $binfile "c++"] == -1} { +if { [get_compiler_info $binfile "c++"] } { return -1 } +if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } { + gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." +} + # # Cause gdb to lookup a specific C++ function and print the demangled # form. diff --git a/gdb/testsuite/gdb.c++/ctti.exp b/gdb/testsuite/gdb.c++/ctti.exp index b8c7cc91e5e..135dcf45538 100644 --- a/gdb/testsuite/gdb.c++/ctti.exp +++ b/gdb/testsuite/gdb.c++/ctti.exp @@ -1,4 +1,4 @@ -# Copyright (C) 1998 Free Software Foundation, Inc. +# Copyright (C) 1998, 1999 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -29,10 +29,7 @@ if $tracelevel then { strace $tracelevel } - -# Check to see if we have an executable to test. If not, then either we -# haven't tried to compile one, or the compilation failed for some reason. -# In either case, just notify the user and skip the tests in this file. +if { [skip_cplus_tests] } { continue } set testfile "cttiadd" set srcfile ${testfile}.cc diff --git a/gdb/testsuite/gdb.c++/demangle.exp b/gdb/testsuite/gdb.c++/demangle.exp index d63ab042a72..0c964316a60 100644 --- a/gdb/testsuite/gdb.c++/demangle.exp +++ b/gdb/testsuite/gdb.c++/demangle.exp @@ -23,6 +23,8 @@ if $tracelevel then { strace $tracelevel } +if { [skip_cplus_tests] } { continue } + ### The demangling style we last sent to GDB. set current_demangling_style none diff --git a/gdb/testsuite/gdb.c++/derivation.exp b/gdb/testsuite/gdb.c++/derivation.exp index 31cdd6f9ac7..031985a496b 100644 --- a/gdb/testsuite/gdb.c++/derivation.exp +++ b/gdb/testsuite/gdb.c++/derivation.exp @@ -39,10 +39,19 @@ if $tracelevel then { set prms_id 0 set bug_id 0 +if { [skip_cplus_tests] } { continue } + set testfile "derivation" set srcfile ${testfile}.cc set binfile ${objdir}/${subdir}/${testfile} +# Create and source the file that provides information about the compiler +# used to compile the test case. + +if [get_compiler_info ${binfile} "c++"] { + return -1 +} + if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } { gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." } diff --git a/gdb/testsuite/gdb.c++/inherit.exp b/gdb/testsuite/gdb.c++/inherit.exp index b1c28ed8fb1..e39b12a3eb7 100644 --- a/gdb/testsuite/gdb.c++/inherit.exp +++ b/gdb/testsuite/gdb.c++/inherit.exp @@ -26,9 +26,8 @@ if $tracelevel then { strace $tracelevel } -# Check to see if we have an executable to test. If not, then either we -# haven't tried to compile one, or the compilation failed for some reason. -# In either case, just notify the user and skip the tests in this file. +if { [skip_cplus_tests] } { continue } + # Note - create separate "inherit" executable from misc.cc set testfile "inherit" diff --git a/gdb/testsuite/gdb.c++/local.exp b/gdb/testsuite/gdb.c++/local.exp index 66b6d63cd91..6ec777b2713 100644 --- a/gdb/testsuite/gdb.c++/local.exp +++ b/gdb/testsuite/gdb.c++/local.exp @@ -1,4 +1,4 @@ -# Copyright (C) 1998 Free Software Foundation, Inc. +# Copyright (C) 1998, 1999 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -33,6 +33,8 @@ if $tracelevel then { set prms_id 0 set bug_id 0 +if { [skip_cplus_tests] } { continue } + set testfile "local" set srcfile ${testfile}.cc set binfile ${objdir}/${subdir}/${testfile} diff --git a/gdb/testsuite/gdb.c++/member-ptr.exp b/gdb/testsuite/gdb.c++/member-ptr.exp index d1de66325ca..b7c6206cb76 100644 --- a/gdb/testsuite/gdb.c++/member-ptr.exp +++ b/gdb/testsuite/gdb.c++/member-ptr.exp @@ -1,4 +1,4 @@ -# Copyright (C) 1998 Free Software Foundation, Inc. +# Copyright (C) 1998, 1999 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -26,6 +26,8 @@ if $tracelevel then { strace $tracelevel } +if { [skip_cplus_tests] } { continue } + # # test running programs # diff --git a/gdb/testsuite/gdb.c++/method.exp b/gdb/testsuite/gdb.c++/method.exp index a0d005bb491..b3c725cfa70 100644 --- a/gdb/testsuite/gdb.c++/method.exp +++ b/gdb/testsuite/gdb.c++/method.exp @@ -1,4 +1,4 @@ -# Copyright (C) 1998 Free Software Foundation, Inc. +# Copyright (C) 1998, 1999 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -42,6 +42,8 @@ if $tracelevel then { set prms_id 0 set bug_id 0 +if { [skip_cplus_tests] } { continue } + set testfile "method" set srcfile ${testfile}.cc set binfile ${objdir}/${subdir}/${testfile} diff --git a/gdb/testsuite/gdb.c++/misc.exp b/gdb/testsuite/gdb.c++/misc.exp index 7d64e4a7fea..07465ac532c 100644 --- a/gdb/testsuite/gdb.c++/misc.exp +++ b/gdb/testsuite/gdb.c++/misc.exp @@ -23,9 +23,7 @@ if $tracelevel then { strace $tracelevel } -# Check to see if we have an executable to test. If not, then either we -# haven't tried to compile one, or the compilation failed for some reason. -# In either case, just notify the user and skip the tests in this file. +if { [skip_cplus_tests] } { continue } set testfile "misc" set srcfile ${testfile}.cc diff --git a/gdb/testsuite/gdb.c++/overload.exp b/gdb/testsuite/gdb.c++/overload.exp index c49d76a6edb..fa12bff2515 100644 --- a/gdb/testsuite/gdb.c++/overload.exp +++ b/gdb/testsuite/gdb.c++/overload.exp @@ -1,4 +1,4 @@ -# Copyright (C) 1998 Free Software Foundation, Inc. +# Copyright (C) 1998, 1999 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -35,6 +35,8 @@ if $tracelevel then { set prms_id 0 set bug_id 0 +if { [skip_cplus_tests] } { continue } + set testfile "overload" set srcfile ${testfile}.cc set binfile ${objdir}/${subdir}/${testfile} diff --git a/gdb/testsuite/gdb.c++/ovldbreak.exp b/gdb/testsuite/gdb.c++/ovldbreak.exp index 34f24047817..d7482bddfba 100644 --- a/gdb/testsuite/gdb.c++/ovldbreak.exp +++ b/gdb/testsuite/gdb.c++/ovldbreak.exp @@ -1,4 +1,4 @@ -# Copyright (C) 1998 Free Software Foundation, Inc. +# Copyright (C) 1998, 1999 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -36,6 +36,8 @@ if $tracelevel then { set prms_id 0 set bug_id 0 +if { [skip_cplus_tests] } { continue } + set testfile "ovldbreak" set srcfile ${testfile}.cc set binfile ${objdir}/${subdir}/${testfile} diff --git a/gdb/testsuite/gdb.c++/ref-types.exp b/gdb/testsuite/gdb.c++/ref-types.exp index 611dc6fedf0..a528fd641de 100644 --- a/gdb/testsuite/gdb.c++/ref-types.exp +++ b/gdb/testsuite/gdb.c++/ref-types.exp @@ -30,6 +30,8 @@ if $tracelevel then { set prms_id 0 set bug_id 0 +if { [skip_cplus_tests] } { continue } + set testfile "ref-types" set srcfile ${testfile}.cc set binfile ${objdir}/${subdir}/${testfile} diff --git a/gdb/testsuite/gdb.c++/templates.exp b/gdb/testsuite/gdb.c++/templates.exp index 6c643b1f647..99c255168bd 100644 --- a/gdb/testsuite/gdb.c++/templates.exp +++ b/gdb/testsuite/gdb.c++/templates.exp @@ -1,4 +1,4 @@ -# Copyright (C) 1992, 1996, 1997 Free Software Foundation, Inc. +# Copyright (C) 1992, 1996, 1997, 1999 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -25,6 +25,8 @@ if $tracelevel then { strace $tracelevel } +if { [skip_cplus_tests] } { continue } + set testfile "templates" set srcfile ${testfile}.cc set binfile ${objdir}/${subdir}/${testfile} diff --git a/gdb/testsuite/gdb.c++/userdef.exp b/gdb/testsuite/gdb.c++/userdef.exp index 055ff0da5ab..8221d9914a8 100644 --- a/gdb/testsuite/gdb.c++/userdef.exp +++ b/gdb/testsuite/gdb.c++/userdef.exp @@ -1,4 +1,5 @@ -# Copyright (C) 1998 Free Software Foundation, Inc. +# Tests of overloaded operators resolution. +# Copyright (C) 1998, 1999 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -19,19 +20,14 @@ # written by Elena Zannoni (ezannoni@cygnus.com) # -# testing overloaded operators resolution. -# # source file "userdef.cc" # - if $tracelevel then { strace $tracelevel } -# Check to see if we have an executable to test. If not, then either we -# haven't tried to compile one, or the compilation failed for some reason. -# In either case, just notify the user and skip the tests in this file. +if { [skip_cplus_tests] } { continue } set testfile "userdef" set srcfile ${testfile}.cc diff --git a/gdb/testsuite/gdb.c++/virtfunc.exp b/gdb/testsuite/gdb.c++/virtfunc.exp index dd73cabf6c1..b023944f951 100644 --- a/gdb/testsuite/gdb.c++/virtfunc.exp +++ b/gdb/testsuite/gdb.c++/virtfunc.exp @@ -26,6 +26,8 @@ if $tracelevel then { strace $tracelevel } +if { [skip_cplus_tests] } { continue } + set testfile "virtfunc" set srcfile ${testfile}.cc set binfile ${objdir}/${subdir}/${testfile} @@ -36,10 +38,6 @@ if [get_compiler_info ${binfile} "c++"] { source ${binfile}.ci -# Check to see if we have an executable to test. If not, then either we -# haven't tried to compile one, or the compilation failed for some reason. -# In either case, just notify the user and skip the tests in this file. - set src "${srcdir}/${subdir}/${srcfile}" if { [gdb_compile "${src}" "${binfile}" executable {c++ debug}] != "" } { gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index ad1e5ad7b29..ab640a380ad 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -830,6 +830,19 @@ proc default_gdb_start { } { return 0; } +# Return a 1 for configurations for which we don't even want to try to +# test C++. + +proc skip_cplus_tests {} { + if { [istarget "d10v-*-*"] } { + return 1 + } + if { [istarget "h8300-*-*"] } { + return 1 + } + return 0 +} + # * For crosses, the CHILL runtime doesn't build because it can't find # setjmp.h, stdio.h, etc. # * For AIX (as of 16 Mar 95), (a) there is no language code for @@ -872,7 +885,7 @@ proc get_compiler_info {binfile args} { if {![istarget "hppa*-*-hpux*"]} { if { [llength $args] > 0 } { if {$args == "c++"} { - if { [gdb_compile "${srcdir}/${subdir}/compiler.cc" "${binfile}.ci" preprocess {}] != "" } { + if { [gdb_compile "${srcdir}/${subdir}/compiler.cc" "${binfile}.ci" preprocess {}] != "" } { perror "Couldn't make ${binfile}.ci file" return 1; } |