diff options
Diffstat (limited to 'gdb/testsuite/gdb.c++/overload.exp')
-rw-r--r-- | gdb/testsuite/gdb.c++/overload.exp | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.c++/overload.exp b/gdb/testsuite/gdb.c++/overload.exp index b1ddb163..e77d2dc 100644 --- a/gdb/testsuite/gdb.c++/overload.exp +++ b/gdb/testsuite/gdb.c++/overload.exp @@ -43,6 +43,12 @@ if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {deb gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." } +# 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 +} gdb_exit gdb_start @@ -87,6 +93,9 @@ gdb_expect { -re "type = class foo \{.*public:.*int ifoo;.*const char \\*ccpfoo;.*foo\\(int\\);.*foo\\(int, (const char|char const) \\*\\);.*foo\\(foo &\\);.*~foo\\(void\\);.*void foofunc\\(int\\);.*void foofunc\\(int, signed char \\*\\);.*int overload1arg\\(void\\);.*int overload1arg\\(char\\);.*int overload1arg\\(signed char\\);.*int overload1arg\\(unsigned char\\);.*int overload1arg\\(short\\);.*int overload1arg\\(unsigned short\\);.*int overload1arg\\(int\\);.*int overload1arg\\(unsigned int\\);.*int overload1arg\\(long\\);.*int overload1arg\\(unsigned long\\);.*int overload1arg\\(float\\);.*int overload1arg\\(double\\);.*int overloadargs\\(int\\);.*int overloadargs\\(int, int\\);.*int overloadargs\\(int, int, int\\);.*int overloadargs\\(int, int, int, int\\);.*int overloadargs\\(int, int, int, int, int\\);.*int overloadargs\\(int, int, int, int, int, int\\);.*int overloadargs\\(int, int, int, int, int, int, int\\);.*int overloadargs\\(int, int, int, int, int, int, int, int\\);.*int overloadargs\\(int, int, int, int, int, int, int, int, int\\);.*int overloadargs\\(int, int, int, int, int, int, int, int, int, int\\);.*int overloadargs\\(int, int, int, int, int, int, int, int, int, int, int\\);\r\n\}\r\n$gdb_prompt $" { pass "ptype foo_instance1 (HP aCC -- known quirk with ~foo parameter list)" } + -re "type = class foo .*int overloadargs\\(int, int, int, int, int, int, int, int, int, int, int\\);\r\n\}\r\n$gdb_prompt $" { + pass "ptype foo_instance1 (shorter match)" + } -re ".*$gdb_prompt $" { fail "ptype foo_instance1" } timeout { fail "(timeout) ptype foo_instance1" } } @@ -110,6 +119,11 @@ gdb_expect { } +# The overload resolver added by HP (valops.c:find_overload_match) doesn't +# work right for G++ output, since the list of parameters seems not to +# be filled in correctly. Until this gets fixed, don't expect to pass +# these tests. +if {$gcc_compiled} then { setup_xfail "*-*-*" } send_gdb "print foo_instance1.overloadargs(1)\n" gdb_expect { @@ -120,6 +134,9 @@ gdb_expect { timeout { fail "(timeout) print call overloaded func 1 arg" } } + +if {$gcc_compiled} then { setup_xfail "*-*-*" } + send_gdb "print foo_instance1.overloadargs(1, 2)\n" gdb_expect { -re ".\[0-9\]* = 2\r\n$gdb_prompt $" { @@ -130,6 +147,8 @@ gdb_expect { } +if {$gcc_compiled} then { setup_xfail "*-*-*" } + send_gdb "print foo_instance1.overloadargs(1, 2, 3)\n" gdb_expect { -re ".\[0-9\]* = 3\r\n$gdb_prompt $" { @@ -140,6 +159,8 @@ gdb_expect { } +if {$gcc_compiled} then { setup_xfail "*-*-*" } + send_gdb "print foo_instance1.overloadargs(1, 2, 3, 4)\n" gdb_expect { -re ".\[0-9\]* = 4\r\n$gdb_prompt $" { @@ -150,6 +171,8 @@ gdb_expect { } +if {$gcc_compiled} then { setup_xfail "*-*-*" } + send_gdb "print foo_instance1.overloadargs(1, 2, 3, 4, 5)\n" gdb_expect { -re ".\[0-9\]* = 5\r\n$gdb_prompt $" { @@ -160,6 +183,8 @@ gdb_expect { } +if {$gcc_compiled} then { setup_xfail "*-*-*" } + send_gdb "print foo_instance1.overloadargs(1, 2, 3, 4, 5, 6)\n" gdb_expect { -re ".\[0-9\]* = 6\r\n$gdb_prompt $" { @@ -170,6 +195,8 @@ gdb_expect { } +if {$gcc_compiled} then { setup_xfail "*-*-*" } + send_gdb "print foo_instance1.overloadargs(1, 2, 3, 4, 5, 6, 7)\n" gdb_expect { -re ".\[0-9\]* = 7\r\n$gdb_prompt $" { @@ -180,6 +207,8 @@ gdb_expect { } +if {$gcc_compiled} then { setup_xfail "*-*-*" } + send_gdb "print foo_instance1.overloadargs(1, 2, 3, 4, 5, 6, 7, 8)\n" gdb_expect { -re ".\[0-9\]* = 8\r\n$gdb_prompt $" { @@ -190,6 +219,8 @@ gdb_expect { } +if {$gcc_compiled} then { setup_xfail "*-*-*" } + send_gdb "print foo_instance1.overloadargs(1, 2, 3, 4, 5, 6, 7, 8, 9)\n" gdb_expect { -re ".\[0-9\]* = 9\r\n$gdb_prompt $" { @@ -200,6 +231,8 @@ gdb_expect { } +if {$gcc_compiled} then { setup_xfail "*-*-*" } + send_gdb "print foo_instance1.overloadargs(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)\n" gdb_expect { -re ".\[0-9\]* = 10\r\n$gdb_prompt $" { @@ -210,6 +243,8 @@ gdb_expect { } +if {$gcc_compiled} then { setup_xfail "*-*-*" } + send_gdb "print foo_instance1.overloadargs(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)\n" gdb_expect { -re ".\[0-9\]* = 11\r\n$gdb_prompt $" { @@ -220,6 +255,8 @@ gdb_expect { } +if {$gcc_compiled} then { setup_xfail "*-*-*" } + send_gdb "print foo_instance1.overload1arg()\n" gdb_expect { -re ".\[0-9\]* = 1\r\n$gdb_prompt $" { @@ -229,6 +266,9 @@ gdb_expect { timeout { fail "(timeout) print call overloaded func void arg" } } + +if {$gcc_compiled} then { setup_xfail "*-*-*" } + send_gdb "print foo_instance1.overload1arg((char)arg2)\n" gdb_expect { -re ".\[0-9\]* = 2\r\n$gdb_prompt $" { @@ -238,6 +278,9 @@ gdb_expect { timeout { fail "(timeout) print call overloaded func char arg" } } + +if {$gcc_compiled} then { setup_xfail "*-*-*" } + send_gdb "print foo_instance1.overload1arg((signed char)arg3)\n" gdb_expect { -re ".\[0-9\]* = 3\r\n$gdb_prompt $" { @@ -248,6 +291,8 @@ gdb_expect { } +if {$gcc_compiled} then { setup_xfail "*-*-*" } + send_gdb "print foo_instance1.overload1arg((unsigned char)arg4)\n" gdb_expect { -re ".\[0-9\]* = 4\r\n$gdb_prompt $" { @@ -258,6 +303,8 @@ gdb_expect { } +if {$gcc_compiled} then { setup_xfail "*-*-*" } + send_gdb "print foo_instance1.overload1arg((short)arg5)\n" gdb_expect { -re ".\[0-9\]* = 5\r\n$gdb_prompt $" { @@ -268,6 +315,8 @@ gdb_expect { } +if {$gcc_compiled} then { setup_xfail "*-*-*" } + send_gdb "print foo_instance1.overload1arg((unsigned short)arg6)\n" gdb_expect { -re ".\[0-9\]* = 6\r\n$gdb_prompt $" { @@ -278,6 +327,8 @@ gdb_expect { } +if {$gcc_compiled} then { setup_xfail "*-*-*" } + send_gdb "print foo_instance1.overload1arg((int)arg7)\n" gdb_expect { -re ".\[0-9\]* = 7\r\n$gdb_prompt $" { @@ -288,6 +339,8 @@ gdb_expect { } +if {$gcc_compiled} then { setup_xfail "*-*-*" } + send_gdb "print foo_instance1.overload1arg((unsigned int)arg8)\n" gdb_expect { -re ".\[0-9\]* = 8\r\n$gdb_prompt $" { @@ -298,6 +351,8 @@ gdb_expect { } +if {$gcc_compiled} then { setup_xfail "*-*-*" } + send_gdb "print foo_instance1.overload1arg((long)arg9)\n" gdb_expect { -re ".\[0-9\]* = 9\r\n$gdb_prompt $" { @@ -308,6 +363,8 @@ gdb_expect { } +if {$gcc_compiled} then { setup_xfail "*-*-*" } + send_gdb "print foo_instance1.overload1arg((unsigned long)arg10)\n" gdb_expect { -re ".\[0-9\]* = 10\r\n$gdb_prompt $" { @@ -318,6 +375,8 @@ gdb_expect { } +if {$gcc_compiled} then { setup_xfail "*-*-*" } + send_gdb "print foo_instance1.overload1arg((float)arg11)\n" gdb_expect { -re ".\[0-9\]* = 11\r\n$gdb_prompt $" { @@ -328,6 +387,8 @@ gdb_expect { } +if {$gcc_compiled} then { setup_xfail "*-*-*" } + send_gdb "print foo_instance1.overload1arg((double)arg12)\n" gdb_expect { -re ".\[0-9\]* = 12\r\n$gdb_prompt $" { |