OSDN Git Service

Update/correct copyright notices.
[pf3gnuchains/pf3gnuchains4x.git] / gdb / testsuite / gdb.c++ / method.exp
index a3939dc..a0e50f9 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 1998 Free Software Foundation, Inc.
+# Copyright 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}
@@ -50,7 +52,9 @@ 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."
 }
 
-
+if [get_compiler_info $binfile "c++"] {
+  return -1
+}
 
 gdb_exit
 gdb_start
@@ -143,7 +147,20 @@ gdb_expect {
 send_gdb "print this\n"
 gdb_expect {
    -re "\\$\[0-9\]* = \\(const class A \\*\\) $hex\r\n$gdb_prompt $" {
+     global gcc_compiled
+     if {$gcc_compiled} {
+       xfail "print this (in bar)"
+     } else {
+       pass "print this (in bar)"
+     }
+   }
+   -re "\\$\[0-9\]* = \\(A \\*\\) $hex\r\n$gdb_prompt $" {
+     global gcc_compiled
+     if {$gcc_compiled} {
        pass "print this (in bar)"
+     } else {
+       xfail "print this (in bar)"
+     }
    }
    -re ".*$gdb_prompt $" { fail "print this (in bar)" }
    timeout { fail "(timeout) print this (in bar)" }
@@ -197,7 +214,7 @@ gdb_expect {
 
 send_gdb "print res\n"
 gdb_expect {
-   -re "\\$\[0-9\]* = \[0-9\]*\r\n$gdb_prompt $" {
+   -re "\\$\[0-9\]* = .\[0-9\]*\r\n$gdb_prompt $" {
        pass "print res in getFunky"
    }
    -re ".*$gdb_prompt $" { fail "print res in getfunky" }
@@ -209,7 +226,7 @@ gdb_expect {
 
 send_gdb "ptype A\n"
 gdb_expect {
-   -re "type = class A \{\r\n\[ \]*public:\r\n\[ \]*int x;\r\n\[ \]*int y;\r\n\r\n\\[ \]*A & operator=\\(A const &\\);\r\n\[ \]*A\\(A const &\\)\r\n\[ \]*A\\(void\\)\r\n[ \]*int foo\\(int\\);\r\n\[ \]*int bar\\(int\\) const;\r\n\[ \]*int baz\\(int, char\\) volatile;\r\n\[ \]*int qux\\(int, float\\) const volatile;\r\n\}\r\n$gdb_prompt $" {
+   -re "type = class A \{\r\n\[ \]*public:\r\n\[ \]*int x;\r\n\[ \]*int y;\r\n\r\n\[ \]*A & operator=\\(A const &\\);\r\n\[ \]*A\\(A const &\\);\r\n\[ \]*A\\(void\\);\r\n\[ \]*int foo\\(int\\);\r\n\[ \]*int bar\\(int\\) const;\r\n\[ \]*int baz\\(int, char\\) volatile;\r\n\[ \]*int qux\\(int, float\\) const volatile;\r\n\}\r\n$gdb_prompt $" {
       pass "ptype A"
    }
    -re "type = class A \{\r\n\[ \]*public:\r\n\[ \]*int x;\r\n\[ \]*int y;\r\n\r\n\[ \]*int foo\\(int\\);\r\n\[ \]*int bar\\(int\\) const;\r\n\[ \]*int baz\\(int, char\\);\r\n\[ \]*int qux\\(int, float\\) const;\r\n\}\r\n$gdb_prompt $" {