home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / gnu / gdb-4.9 / gdb / testsuite / gdb.t20 / inherit.exp < prev    next >
Encoding:
Text File  |  1993-05-12  |  46.2 KB  |  1,659 lines

  1. # Copyright (C) 1992 Free Software Foundation, Inc.
  2.  
  3. # This program is free software; you can redistribute it and/or modify
  4. # it under the terms of the GNU General Public License as published by
  5. # the Free Software Foundation; either version 2 of the License, or
  6. # (at your option) any later version.
  7. # This program is distributed in the hope that it will be useful,
  8. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  10. # GNU General Public License for more details.
  11. # You should have received a copy of the GNU General Public License
  12. # along with this program; if not, write to the Free Software
  13. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  14.  
  15. # Please email any bugs, comments, and/or additions to this file to:
  16. # bug-gdb@prep.ai.mit.edu
  17.  
  18. # This file was written by Fred Fish. (fnf@cygnus.com)
  19.  
  20. if $tracelevel then {
  21.     strace $tracelevel
  22. }
  23.  
  24. #
  25. # Single inheritance, print individual members.
  26. #
  27.  
  28. proc test_print_si_members {} {
  29.     global prompt
  30.  
  31.     set passcount 0
  32.  
  33.     # Print all members of g_A using fully qualified form.
  34.  
  35.     send "print g_A.A::a\n"
  36.     expect {
  37.     -re ".* = 1\r\n$prompt $" { incr passcount }
  38.     -re ".*$prompt $" { fail "print g_A.A::a" }
  39.     timeout { fail "print g_A.A::a (timeout)" ; return }
  40.     }
  41.  
  42.     send "print g_A.A::x\n"
  43.     expect {
  44.     -re ".* = 2\r\n$prompt $" { incr passcount }
  45.     -re ".*$prompt $" { fail "print g_A.A::x" }
  46.     timeout { fail "print g_A.A::x (timeout)" ; return }
  47.     }
  48.  
  49.     # Print members of g_A using nonambiguous compact form.
  50.  
  51.     send "print g_A.a\n"
  52.     expect {
  53.     -re ".* = 1\r\n$prompt $" { incr passcount }
  54.     -re ".*$prompt $" { fail "print g_A.a" }
  55.     timeout { fail "print g_A.a (timeout)" ; return }
  56.     }
  57.  
  58.     send "print g_A.x\n"
  59.     expect {
  60.     -re ".* = 2\r\n$prompt $" { incr passcount }
  61.     -re ".*$prompt $" { fail "print g_A.x" }
  62.     timeout { fail "print g_A.x (timeout)" ; return }
  63.     }
  64.  
  65.     # Print all members of g_B using fully qualified form.
  66.  
  67.     send "print g_B.A::a\n"
  68.     expect {
  69.     -re ".* = 3\r\n$prompt $" { incr passcount }
  70.     -re ".*$prompt $" { fail "print g_B.A::a" }
  71.     timeout { fail "print g_B.A::a (timeout)" ; return }
  72.     }
  73.  
  74.     send "print g_B.A::x\n"
  75.     expect {
  76.     -re ".* = 4\r\n$prompt $" { incr passcount }
  77.     -re ".*$prompt $" { fail "print g_B.A::x" }
  78.     timeout { fail "print g_B.A::x (timeout)" ; return }
  79.     }
  80.  
  81.     send "print g_B.B::b\n"
  82.     expect {
  83.     -re ".* = 5\r\n$prompt $" { incr passcount }
  84.     -re ".*$prompt $" { fail "print g_B.B::b" }
  85.     timeout { fail "print g_B.B::b (timeout)" ; return }
  86.     }
  87.  
  88.     send "print g_B.B::x\n"
  89.     expect {
  90.     -re ".* = 6\r\n$prompt $" { incr passcount }
  91.     -re ".*$prompt $" { fail "print g_B.B::x" }
  92.     timeout { fail "print g_B.B::x (timeout)" ; return }
  93.     }
  94.  
  95.     # Print members of g_B using nonambiguous compact form.
  96.  
  97.     send "print g_B.a\n"
  98.     expect {
  99.     -re ".* = 3\r\n$prompt $" { incr passcount }
  100.     -re "There is no member named a.*$prompt $" {
  101.         setup_xfail "*-*-*"
  102.         fail "print g_B.a"
  103.     }
  104.     -re ".*$prompt $" { fail "print g_B.a" }
  105.     timeout { fail "print g_B.a (timeout)" ; return }
  106.     }
  107.  
  108.     send "print g_B.b\n"
  109.     expect {
  110.     -re ".* = 5\r\n$prompt $" { incr passcount }
  111.     -re ".*$prompt $" { fail "print g_B.b" }
  112.     timeout { fail "print g_B.b (timeout)" ; return }
  113.     }
  114.  
  115.     send "print g_B.x\n"
  116.     expect {
  117.     -re ".* = 6\r\n$prompt $" { incr passcount }
  118.     -re ".*$prompt $" { fail "print g_B.x" }
  119.     timeout { fail "print g_B.x (timeout)" ; return }
  120.     }
  121.  
  122.     # Print all members of g_C using fully qualified form.
  123.  
  124.     send "print g_C.A::a\n"
  125.     expect {
  126.     -re ".* = 7\r\n$prompt $" { incr passcount }
  127.     -re ".*$prompt $" { fail "print g_C.A::a" }
  128.     timeout { fail "print g_C.A::a (timeout)" ; return }
  129.     }
  130.  
  131.     send "print g_C.A::x\n"
  132.     expect {
  133.     -re ".* = 8\r\n$prompt $" { incr passcount }
  134.     -re ".*$prompt $" { fail "print g_C.A::x" }
  135.     timeout { fail "print g_C.A::x (timeout)" ; return }
  136.     }
  137.  
  138.     send "print g_C.C::c\n"
  139.     expect {
  140.     -re ".* = 9\r\n$prompt $" { incr passcount }
  141.     -re ".*$prompt $" { fail "print g_C.C::c" }
  142.     timeout { fail "print g_C.C::c (timeout)" ; return }
  143.     }
  144.  
  145.     send "print g_C.C::x\n"
  146.     expect {
  147.     -re ".* = 10\r\n$prompt $" { incr passcount }
  148.     -re ".*$prompt $" { fail "print g_C.C::x" }
  149.     timeout { fail "print g_C.C::x (timeout)" ; return }
  150.     }
  151.  
  152.     # Print members of g_C using nonambiguous compact form.
  153.  
  154.     send "print g_C.a\n"
  155.     expect {
  156.     -re ".* = 7\r\n$prompt $" { incr passcount }
  157.     -re "There is no member named a.*$prompt $" {
  158.         setup_xfail "*-*-*"
  159.         fail "print g_B.a"
  160.     }
  161.     -re ".*$prompt $" { fail "print g_C.a" }
  162.     timeout { fail "print g_C.a (timeout)" ; return }
  163.     }
  164.  
  165.     send "print g_C.c\n"
  166.     expect {
  167.     -re ".* = 9\r\n$prompt $" { incr passcount }
  168.     -re ".*$prompt $" { fail "print g_C.c" }
  169.     timeout { fail "print g_C.c (timeout)" ; return }
  170.     }
  171.  
  172.     send "print g_C.x\n"
  173.     expect {
  174.     -re ".* = 10\r\n$prompt $" { incr passcount }
  175.     -re ".*$prompt $" { fail "print g_C.x" }
  176.     timeout { fail "print g_C.x (timeout)" ; return }
  177.     }
  178.  
  179.     if $passcount then {
  180.     pass "$passcount correct si members printed"
  181.     }
  182. }
  183.  
  184. #
  185. # Single inheritance, print type definitions.
  186. #
  187.  
  188. proc test_ptype_si {} {
  189.     global prompt
  190.  
  191.     set passcount 0
  192.  
  193.     # Print class A as a type.
  194.  
  195.     setup_xfail "*-*-*"
  196.     send "ptype A\n"
  197.     expect {
  198.     -re "type = class A \{\r\n\[ \]*int a;\r\n\[ \]*int x;\r\n\[ \]*\}\r\n$prompt $" {
  199.         incr passcount
  200.     }
  201.     -re "type = struct A \{\r\n\[ \]*int a;\r\n\[ \]*int x;\r\n\[ \]*\}\r\n$prompt $" {
  202.         fail "ptype A (FIXME)"
  203.     }
  204.     -re ".*$prompt $" { fail "ptype A" }
  205.     timeout { fail "ptype A (timeout)" ; return }
  206.     }
  207.  
  208.     # Print class A as an explicit class.
  209.  
  210.     setup_xfail "*-*-*"
  211.     send "ptype class A\n"
  212.     expect {
  213.     -re "type = class A \{\r\n\[ \]*int a;\r\n\[ \]*int x;\r\n\[ \]*\}\r\n$prompt $" {
  214.         incr passcount
  215.     }
  216.     -re "type = struct A \{\r\n\[ \]*int a;\r\n\[ \]*int x;\r\n\[ \]*\}\r\n$prompt $" {
  217.         fail "ptype class A (FIXME)"
  218.     }
  219.     -re ".*$prompt $" { fail "ptype class A" }
  220.     timeout { fail "ptype class A (timeout)" ; return }
  221.     }
  222.  
  223.     # Print type of an object of type A.
  224.  
  225.     setup_xfail "*-*-*"
  226.     send "ptype g_A\n"
  227.     expect {
  228.     -re "type = class A \{\r\n\[ \]*int a;\r\n\[ \]*int x;\r\n\[ \]*\}\r\n$prompt $" {
  229.         incr passcount
  230.     }
  231.     -re "type = struct A \{\r\n\[ \]*int a;\r\n\[ \]*int x;\r\n\[ \]*\}\r\n$prompt $" {
  232.         fail "ptype g_A (FIXME)"
  233.     }
  234.     -re ".*$prompt $" { fail "ptype g_A" }
  235.     timeout { fail "ptype g_A (timeout)" ; return }
  236.     }
  237.  
  238.     # Print class B as a type.
  239.  
  240.     send "ptype B\n"
  241.     expect {
  242.     -re "type = class B : public A \{\r\n\[ \]*public:\r\n\[ \]*int b;\r\n\[ \]*int x;\r\n\}\r\n$prompt $" {
  243.         incr passcount
  244.     }
  245.     -re "type = struct B \{\r\n\[ \]*struct A A;\r\n\[ \]*int b;\r\n\[ \]*int x;\r\n\}\r\n$prompt $" {
  246.         setup_xfail "*-*-*"
  247.         fail "ptype B"
  248.     }
  249.     -re ".*$prompt $" { fail "ptype B" }
  250.     timeout { fail "ptype B (timeout)" ; return }
  251.     }
  252.  
  253.     # Print class B as an explicit class.
  254.  
  255.     send "ptype class B\n"
  256.     expect {
  257.     -re "type = class B : public A \{\r\n\[ \]*public:\r\n\[ \]*int b;\r\n\[ \]*int x;\r\n\}\r\n$prompt $" {
  258.         incr passcount
  259.     }
  260.     -re "type = struct B \{\r\n\[ \]*struct A A;\r\n\[ \]*int b;\r\n\[ \]*int x;\r\n\}\r\n$prompt $" {
  261.         setup_xfail "*-*-*"
  262.         fail "ptype class B"
  263.     }
  264.     -re ".*$prompt $" { fail "ptype class B" }
  265.     timeout { fail "ptype class B (timeout)" ; return }
  266.     }
  267.  
  268.     # Print type of an object of type B.
  269.  
  270.     send "ptype g_B\n"
  271.     expect {
  272.     -re "type = class B : public A \{\r\n\[ \]*public:\r\n\[ \]*int b;\r\n\[ \]*int x;\r\n\}\r\n$prompt $" {
  273.         incr passcount
  274.     }
  275.     -re "type = struct B \{\r\n\[ \]*struct A A;\r\n\[ \]*int b;\r\n\[ \]*int x;\r\n\}\r\n$prompt $" {
  276.         setup_xfail "*-*-*"
  277.         fail "ptype g_B"
  278.     }
  279.     -re ".*$prompt $" { fail "ptype g_B" }
  280.     timeout { fail "ptype g_B (timeout)" ; return }
  281.     }
  282.  
  283.     # Print class C as a type.
  284.  
  285.     send "ptype C\n"
  286.     expect {
  287.     -re "type = class C : public A \{\r\n\[ \]*public:\r\n\[ \]*int c;\r\n\[ \]*int x;\r\n\}\r\n$prompt $" {
  288.         incr passcount
  289.     }
  290.     -re "type = struct C \{\r\n\[ \]*struct A A;\r\n\[ \]*int c;\r\n\[ \]*int x;\r\n\}\r\n$prompt $" {
  291.         setup_xfail "*-*-*"
  292.         fail "ptype C"
  293.     }
  294.     -re ".*$prompt $" { fail "ptype C" }
  295.     timeout { fail "ptype C (timeout)" ; return }
  296.     }
  297.  
  298.     # Print class C as an explicit class.
  299.  
  300.     send "ptype class C\n"
  301.     expect {
  302.     -re "type = class C : public A \{\r\n\[ \]*public:\r\n\[ \]*int c;\r\n\[ \]*int x;\r\n\}\r\n$prompt $" {
  303.         incr passcount
  304.     }
  305.     -re "type = struct C \{\r\n\[ \]*struct A A;\r\n\[ \]*int c;\r\n\[ \]*int x;\r\n\}\r\n$prompt $" {
  306.         setup_xfail "*-*-*"
  307.         fail "ptype class C"
  308.     }
  309.     -re ".*$prompt $" { fail "ptype class C" }
  310.     timeout { fail "ptype class C (timeout)" ; return }
  311.     }
  312.  
  313.     # Print type of an object of type g_C.
  314.  
  315.     send "ptype g_C\n"
  316.     expect {
  317.     -re "type = class C : public A \{\r\n\[ \]*public:\r\n\[ \]*int c;\r\n\[ \]*int x;\r\n\}\r\n$prompt $" {
  318.         incr passcount
  319.     }
  320.     -re "type = struct C \{\r\n\[ \]*struct A A;\r\n\[ \]*int c;\r\n\[ \]*int x;\r\n\}\r\n$prompt $" {
  321.         setup_xfail "*-*-*"
  322.         fail "ptype g_C"
  323.     }
  324.     -re ".*$prompt $" { fail "ptype g_C" }
  325.     timeout { fail "ptype g_C (timeout)" ; return }
  326.     }
  327.  
  328.     if $passcount then {
  329.     pass "$passcount correct si types printed"
  330.     }
  331. }
  332.  
  333. #
  334. # Single inheritance, print complete classes.
  335. #
  336.  
  337. proc test_print_si_classes {} {
  338.     global prompt
  339.  
  340.     set passcount 0
  341.  
  342.     # Print all members of g_A.
  343.  
  344.     send "print g_A\n"
  345.     expect {
  346.     -re ".* = \{a = 1, x = 2\}\r\n$prompt $" {
  347.         incr passcount
  348.     }
  349.     -re ".*$prompt $" { fail "print g_A" }
  350.     timeout { fail "print g_A (timeout)" ; return }
  351.     }
  352.  
  353.     # Print all members of g_B.
  354.  
  355.     send "print g_B\n"
  356.     expect {
  357.     -re ".* = \{\<A\> = \{a = 3, x = 4\}, b = 5, x = 6\}\r\n$prompt $" {
  358.         incr passcount
  359.     }
  360.     -re ".* = \{A = \{a = 3, x = 4\}, b = 5, x = 6\}\r\n$prompt $" {
  361.         setup_xfail "*-*-*"
  362.         fail "print g_B"
  363.     }
  364.     -re ".*$prompt $" { fail "print g_B" }
  365.     timeout { fail "print g_B (timeout)" ; return }
  366.     }
  367.  
  368.     # Print all members of g_C.
  369.  
  370.     send "print g_C\n"
  371.     expect {
  372.     -re ".* = \{\<A\> = \{a = 7, x = 8\}, c = 9, x = 10\}\r\n$prompt $" {
  373.         incr passcount
  374.     }
  375.     -re ".* = \{A = \{a = 7, x = 8\}, c = 9, x = 10\}\r\n$prompt $" {
  376.         setup_xfail "*-*-*"
  377.         fail "print g_C"
  378.     }
  379.     -re ".*$prompt $" { fail "print g_C" }
  380.     timeout { fail "print g_C (timeout)" ; return }
  381.     }
  382.  
  383.     if $passcount then {
  384.     pass "$passcount correct si classes printed"
  385.     }
  386. }
  387.  
  388. #
  389. # Multiple inheritance, print individual members.
  390. #
  391.  
  392. proc test_print_mi_members {} {
  393.     global prompt
  394.  
  395.     set passcount 0
  396.  
  397.     # Print all members of g_A.
  398.  
  399.     send "print g_A.A::a\n"
  400.     expect {
  401.     -re ".* = 1\r\n$prompt $" { incr passcount }
  402.     -re ".*$prompt $" { fail "print g_A.A::a" }
  403.     timeout { fail "print g_A.A::a (timeout)" ; return }
  404.     }
  405.     
  406.     send "print g_A.A::x\n"
  407.     expect {
  408.     -re ".* = 2\r\n$prompt $" { incr passcount }
  409.     -re ".*$prompt $" { fail "print g_A.A::x" }
  410.     timeout { fail "print g_A.A::x (timeout)" ; return }
  411.     }
  412.  
  413.     # Print all members of g_B.
  414.  
  415.     send "print g_B.A::a\n"
  416.     expect {
  417.     -re ".* = 3\r\n$prompt $" { incr passcount }
  418.     -re ".*$prompt $" { fail "print g_B.A::a" }
  419.     timeout { fail "print g_B.A::a (timeout)" ; return }
  420.     }
  421.  
  422.     send "print g_B.A::x\n"
  423.     expect {
  424.     -re ".* = 4\r\n$prompt $" { incr passcount }
  425.     -re ".*$prompt $" { fail "print g_B.A::x" }
  426.     timeout { fail "print g_B.A::x (timeout)" ; return }
  427.     }
  428.  
  429.     send "print g_B.B::b\n"
  430.     expect {
  431.     -re ".* = 5\r\n$prompt $" { incr passcount }
  432.     -re ".*$prompt $" { fail "print g_B.B::b" }
  433.     timeout { fail "print g_B.B::b (timeout)" ; return }
  434.     }
  435.  
  436.     send "print g_B.B::x\n"
  437.     expect {
  438.     -re ".* = 6\r\n$prompt $" { incr passcount }
  439.     -re ".*$prompt $" { fail "print g_B.B::x" }
  440.     timeout { fail "print g_B.B::x (timeout)" ; return }
  441.     }
  442.  
  443.     # Print all members of g_C.
  444.  
  445.     send "print g_C.A::a\n"
  446.     expect {
  447.     -re ".* = 7\r\n$prompt $" { incr passcount }
  448.     -re ".*$prompt $" { fail "print g_C.A::a" }
  449.     timeout { fail "print g_C.A::a (timeout)" ; return }
  450.     }
  451.  
  452.     send "print g_C.A::x\n"
  453.     expect {
  454.     -re ".* = 8\r\n$prompt $" { incr passcount }
  455.     -re ".*$prompt $" { fail "print g_C.A::x" }
  456.     timeout { fail "print g_C.A::x (timeout)" ; return }
  457.     }
  458.  
  459.     send "print g_C.C::c\n"
  460.     expect {
  461.     -re ".* = 9\r\n$prompt $" { incr passcount }
  462.     -re ".*$prompt $" { fail "print g_C.C::c" }
  463.     timeout { fail "print g_C.C::c (timeout)" ; return }
  464.     }
  465.  
  466.     send "print g_C.C::x\n"
  467.     expect {
  468.     -re ".* = 10\r\n$prompt $" { incr passcount }
  469.     -re ".*$prompt $" { fail "print g_C.C::x" }
  470.     timeout { fail "print g_C.C::x (timeout)" ; return }
  471.     }
  472.  
  473.     # Print all members of g_D.
  474.  
  475.     # The following is ambiguous, and gdb should detect this.
  476.     # For now, accept gdb's behavior as an expected failure if it
  477.     # simply prints either member correctly.
  478.  
  479.     setup_xfail "*-*-*"
  480.     send "print g_D.A::a\n"
  481.     expect {
  482.     -re ".* = 11\r\n$prompt $" {
  483.         fail "print g_D.A::a (FIXME)"
  484.     }
  485.     -re ".* = 15\r\n$prompt $" {
  486.         fail "print g_D.A::a (FIXME)"
  487.     }
  488.     -re ".*$prompt $" { fail "print g_D.A::a" }
  489.     timeout { fail "print g_D.A::a (timeout)" ; return }
  490.     }
  491.  
  492.     # The following is ambiguous, and gdb should detect this.
  493.     # For now, accept gdb's behavior as an expected failure if it
  494.     # simply prints either member correctly.
  495.  
  496.     setup_xfail "*-*-*"
  497.     send "print g_D.A::x\n"
  498.     expect {
  499.     -re ".* = 12\r\n$prompt $" {
  500.         fail "print g_D.A::x (FIXME)"
  501.     }
  502.     -re ".* = 16\r\n$prompt $" {
  503.         fail "print g_D.A::x (FIXME)"
  504.     }
  505.     -re ".*$prompt $" { fail "print g_D.A::x" }
  506.     timeout { fail "print g_D.A::x (timeout)" ; return }
  507.     }
  508.  
  509.     send "print g_D.B::b\n"
  510.     expect {
  511.     -re ".* = 13\r\n$prompt $" { incr passcount }
  512.     -re ".*$prompt $" { fail "print g_D.B::b" }
  513.     timeout { fail "print g_D.B::b (timeout)" ; return }
  514.     }
  515.  
  516.     send "print g_D.B::x\n"
  517.     expect {
  518.     -re ".* = 14\r\n$prompt $" { incr passcount }
  519.     -re ".*$prompt $" { fail "print g_D.B::x" }
  520.     timeout { fail "print g_D.B::x (timeout)" ; return }
  521.     }
  522.  
  523.     # The following is ambiguous, and gdb should detect this.
  524.     # For now, accept gdb's behavior as an expected failure if it
  525.     # simply prints either member correctly.
  526.  
  527.     setup_xfail "*-*-*"
  528.     send "print g_D.A::a\n"
  529.     expect {
  530.     -re ".* = 11\r\n$prompt $" {
  531.         fail "print g_D.A::a (FIXME)"
  532.     }
  533.     -re ".* = 15\r\n$prompt $" {
  534.         fail "print g_D.A::a (FIXME)"
  535.     }
  536.     -re ".*$prompt $" { fail "print g_D.A::a" }
  537.     timeout { fail "print g_D.A::a (timeout)" ; return }
  538.     }
  539.  
  540.     # The following is ambiguous, and gdb should detect this.
  541.     # For now, accept gdb's behavior as an expected failure if it
  542.     # simply prints either member correctly.
  543.  
  544.     setup_xfail "*-*-*"
  545.     send "print g_D.A::x\n"
  546.     expect {
  547.     -re ".* = 12\r\n$prompt $" {
  548.         fail "print g_D.A::x (FIXME)"
  549.     }
  550.     -re ".* = 16\r\n$prompt $" {
  551.         fail "print g_D.A::x (FIXME)"
  552.     }
  553.     -re ".*$prompt $" { fail "print g_D.A::x" }
  554.     timeout { fail "print g_D.A::x (timeout)" ; return }
  555.     }
  556.  
  557.     send "print g_D.C::c\n"
  558.     expect {
  559.     -re ".* = 17\r\n$prompt $" { incr passcount }
  560.     -re ".* = 13\r\n$prompt $" {
  561.         setup_xfail "*-*-*" 2428
  562.         fail "print g_D.C::c"
  563.     }
  564.     -re ".*$prompt $" { fail "print g_D.C::c" }
  565.     timeout { fail "print g_D.C::c (timeout)" ; return }
  566.     }
  567.  
  568.     send "print g_D.C::x\n"
  569.     expect {
  570.     -re ".* = 18\r\n$prompt $" { incr passcount }
  571.     -re ".* = 14\r\n$prompt $" {
  572.         setup_xfail "*-*-*" 2428
  573.         fail "print g_D.C::x"
  574.     }
  575.     -re ".*$prompt $" { fail "print g_D.C::x" }
  576.     timeout { fail "print g_D.C::x (timeout)" ; return }
  577.     }
  578.  
  579.     send "print g_D.D::d\n"
  580.     expect {
  581.     -re ".* = 19\r\n$prompt $" { incr passcount }
  582.     -re ".*$prompt $" { fail "print g_D.D::d" }
  583.     timeout { fail "print g_D.D::d (timeout)" ; return }
  584.     }
  585.  
  586.     send "print g_D.D::x\n"
  587.     expect {
  588.     -re ".* = 20\r\n$prompt $" { incr passcount }
  589.     -re ".*$prompt $" { fail "print g_D.D::x" }
  590.     timeout { fail "print g_D.D::x (timeout)" ; return }
  591.     }
  592.  
  593.     # Print all members of g_E.
  594.  
  595.     # The following is ambiguous, and gdb should detect this.
  596.     # For now, accept gdb's behavior as an expected failure if it
  597.     # simply prints either member correctly.
  598.  
  599.     setup_xfail "*-*-*"
  600.     send "print g_E.A::a\n"
  601.     expect {
  602.     -re ".* = 21\r\n$prompt $" {
  603.         fail "print g_E.A::a (FIXME)"
  604.     }
  605.     -re ".* = 25\r\n$prompt $" {
  606.         fail "print g_E.A::a (FIXME)"
  607.     }
  608.     -re ".*$prompt $" { fail "print g_E.A::a" }
  609.     timeout { fail "print g_E.A::a (timeout)" ; return }
  610.     }
  611.  
  612.     # The following is ambiguous, and gdb should detect this.
  613.     # For now, accept gdb's behavior as an expected failure if it
  614.     # simply prints either member correctly.
  615.  
  616.     setup_xfail "*-*-*"
  617.     send "print g_E.A::x\n"
  618.     expect {
  619.     -re ".* = 22\r\n$prompt $" {
  620.         fail "print g_E.A::x (FIXME)"
  621.     }
  622.     -re ".* = 26\r\n$prompt $" {
  623.         fail "print g_E.A::x (FIXME)"
  624.     }
  625.     -re ".*$prompt $" { fail "print g_E.A::x" }
  626.     timeout { fail "print g_E.A::x (timeout)" ; return }
  627.     }
  628.  
  629.     send "print g_E.B::b\n"
  630.     expect {
  631.     -re ".* = 23\r\n$prompt $" { incr passcount }
  632.     -re ".*$prompt $" { fail "print g_E.B::b" }
  633.     timeout { fail "print g_E.B::b (timeout)" ; return }
  634.     }
  635.  
  636.     send "print g_E.B::x\n"
  637.     expect {
  638.     -re ".* = 24\r\n$prompt $" { incr passcount }
  639.     -re ".*$prompt $" { fail "print g_E.B::x" }
  640.     timeout { fail "print g_E.B::x (timeout)" ; return }
  641.     }
  642.  
  643.     # The following is ambiguous, and gdb should detect this.
  644.     # For now, accept gdb's behavior as an expected failure if it
  645.     # simply prints either member correctly.
  646.  
  647.     setup_xfail "*-*-*"
  648.     send "print g_E.A::a\n"
  649.     expect {
  650.     -re ".* = 21\r\n$prompt $" {
  651.         fail "print g_E.A::a (FIXME)"
  652.     }
  653.     -re ".* = 25\r\n$prompt $" {
  654.         fail "print g_E.A::a (FIXME)"
  655.     }
  656.     -re ".*$prompt $" { fail "print g_E.A::a" }
  657.     timeout { fail "print g_E.A::a (timeout)" ; return }
  658.     }
  659.  
  660.     # The following is ambiguous, and gdb should detect this.
  661.     # For now, accept gdb's behavior as an expected failure if it
  662.     # simply prints either member correctly.
  663.  
  664.     setup_xfail "*-*-*"
  665.     send "print g_E.A::x\n"
  666.     expect {
  667.     -re ".* = 22\r\n$prompt $" {
  668.         fail "print g_E.A::x (FIXME)"
  669.     }
  670.     -re ".* = 26\r\n$prompt $" {
  671.         fail "print g_E.A::x (FIXME)"
  672.     }
  673.     -re ".*$prompt $" { fail "print g_E.A::x" }
  674.     timeout { fail "print g_E.A::x (timeout)" ; return }
  675.     }
  676.  
  677.     send "print g_E.C::c\n"
  678.     expect {
  679.     -re ".* = 27\r\n$prompt $" { incr passcount }
  680.     -re ".* = 23\r\n$prompt $" {
  681.         setup_xfail "*-*-*" 2428
  682.         fail "print g_E.C::c"
  683.     }
  684.     -re ".*$prompt $" { fail "print g_E.C::c" }
  685.     timeout { fail "print g_E.C::c (timeout)" ; return }
  686.     }
  687.  
  688.     send "print g_E.C::x\n"
  689.     expect {
  690.     -re ".* = 28\r\n$prompt $" { incr passcount }
  691.     -re ".* = 24\r\n$prompt $" {
  692.         setup_xfail "*-*-*" 2428
  693.         fail "print g_E.C::x"
  694.     }
  695.     -re ".*$prompt $" { fail "print g_E.C::x" }
  696.     timeout { fail "print g_E.C::x (timeout)" ; return }
  697.     }
  698.  
  699.     send "print g_E.D::d\n"
  700.     expect {
  701.     -re ".* = 29\r\n$prompt $" { incr passcount }
  702.     -re ".*$prompt $" { fail "print g_E.D::d" }
  703.     timeout { fail "print g_E.D::d (timeout)" ; return }
  704.     }
  705.  
  706.     send "print g_E.D::x\n"
  707.     expect {
  708.     -re ".* = 30\r\n$prompt $" { incr passcount }
  709.     -re ".*$prompt $" { fail "print g_E.D::x" }
  710.     timeout { fail "print g_E.D::x (timeout)" ; return }
  711.     }
  712.  
  713.     send "print g_E.E::e\n"
  714.     expect {
  715.     -re ".* = 31\r\n$prompt $" { incr passcount }
  716.     -re ".*$prompt $" { fail "print g_E.E::e" }
  717.     timeout { fail "print g_E.E::e (timeout)" ; return }
  718.     }
  719.  
  720.     send "print g_E.E::x\n"
  721.     expect {
  722.     -re ".* = 32\r\n$prompt $" { incr passcount }
  723.     -re ".*$prompt $" { fail "print g_E.E::x" }
  724.     timeout { fail "print g_E.E::x (timeout)" ; return }
  725.     }
  726.  
  727.     if $passcount then {
  728.     pass "$passcount correct mi members printed"
  729.     }
  730. }
  731.  
  732. #
  733. # Multiple inheritance, print type definitions.
  734. #
  735.  
  736. proc test_ptype_mi {} {
  737.     global prompt
  738.  
  739.     set passcount 0
  740.  
  741.     send "ptype D\n"
  742.     expect {
  743.     -re "type = class D : public B, public C \{\r\n\[ \]*public:\r\n\[ \]*int d;\r\n\[ \]*int x;\r\n\}\r\n$prompt $" {
  744.         incr passcount
  745.     }
  746.     -re "type = struct D \{\r\n\[ \]*struct B B;\r\n\[ \]*struct C C;\r\n\[ \]*int d;\r\n\[ \]*int x;\r\n\}\r\n$prompt $" {
  747.         setup_xfail "*-*-*"
  748.         fail "ptype D"
  749.     }
  750.     -re ".*$prompt $" { fail "ptype D" }
  751.     timeout { fail "ptype D (timeout)" ; return }
  752.     }
  753.  
  754.     send "ptype class D\n"
  755.     expect {
  756.     -re "type = class D : public B, public C \{\r\n\[ \]*public:\r\n\[ \]*int d;\r\n\[ \]*int x;\r\n\}\r\n$prompt $" {
  757.         incr passcount
  758.     }
  759.     -re "type = struct D \{\r\n\[ \]*struct B B;\r\n\[ \]*struct C C;\r\n\[ \]*int d;\r\n\[ \]*int x;\r\n\}\r\n$prompt $" {
  760.         setup_xfail "*-*-*"
  761.         fail "ptype class D"
  762.     }
  763.     -re ".*$prompt $" { fail "ptype class D" }
  764.     timeout { fail "ptype class D (timeout)" ; return }
  765.     }
  766.  
  767.     send "ptype g_D\n"
  768.     expect {
  769.     -re "type = class D : public B, public C \{\r\n\[ \]*public:\r\n\[ \]*int d;\r\n\[ \]*int x;\r\n\}\r\n$prompt $" {
  770.         incr passcount
  771.     }
  772.     -re "type = struct D \{\r\n\[ \]*struct B B;\r\n\[ \]*struct C C;\r\n\[ \]*int d;\r\n\[ \]*int x;\r\n\}\r\n$prompt $" {
  773.         setup_xfail "*-*-*"
  774.         fail "ptype g_D"
  775.     }
  776.     -re ".*$prompt $" { fail "ptype g_D" }
  777.     timeout { fail "ptype g_D (timeout)" ; return }
  778.     }
  779.  
  780.     send "ptype E\n"
  781.     expect {
  782.     -re "type = class E : public D \{\r\n\[ \]*public:\r\n\[ \]*int e;\r\n\[ \]*int x;\r\n\}\r\n$prompt $" {
  783.         incr passcount
  784.     }
  785.     -re "type = struct E \{\r\n\[ \]*struct D D;\r\n\[ \]*int e;\r\n\[ \]*int x;\r\n\}\r\n$prompt $" {
  786.         setup_xfail "*-*-*"
  787.         fail "ptype E"
  788.     }
  789.     -re ".*$prompt $" { fail "ptype E" }
  790.     timeout { fail "ptype E (timeout)" ; return }
  791.     }
  792.  
  793.     send "ptype class E\n"
  794.     expect {
  795.     -re "type = class E : public D \{\r\n\[ \]*public:\r\n\[ \]*int e;\r\n\[ \]*int x;\r\n\}\r\n$prompt $" {
  796.         incr passcount
  797.     }
  798.     -re "type = struct E \{\r\n\[ \]*struct D D;\r\n\[ \]*int e;\r\n\[ \]*int x;\r\n\}\r\n$prompt $" {
  799.         setup_xfail "*-*-*"
  800.         fail "ptype class E"
  801.     }
  802.     -re ".*$prompt $" { fail "ptype class E" }
  803.     timeout { fail "ptype class E (timeout)" ; return }
  804.     }
  805.  
  806.     send "ptype g_E\n"
  807.     expect {
  808.     -re "type = class E : public D \{\r\n\[ \]*public:\r\n\[ \]*int e;\r\n\[ \]*int x;\r\n\}\r\n$prompt $" {
  809.         incr passcount
  810.     }
  811.     -re "type = struct E \{\r\n\[ \]*struct D D;\r\n\[ \]*int e;\r\n\[ \]*int x;\r\n\}\r\n$prompt $" {
  812.         setup_xfail "*-*-*"
  813.         fail "ptype g_E"
  814.     }
  815.     -re ".*$prompt $" { fail "ptype g_E" }
  816.     timeout { fail "ptype g_E (timeout)" ; return }
  817.     }
  818.  
  819.     if $passcount then {
  820.     pass "$passcount correct mi types printed"
  821.     }
  822. }
  823.  
  824. #
  825. # Multiple inheritance, print complete classes.
  826. #
  827.  
  828. proc test_print_mi_classes {} {
  829.     global prompt
  830.  
  831.     set passcount 0
  832.  
  833.     # Print all members of g_D.
  834.  
  835.     send "print g_D\n"
  836.     expect {
  837.     -re ".* = \{\<B\> = \{\<A\> = \{a = 11, x = 12\}, b = 13, x = 14\}, \<C\> = \{\<A\> = \{a = 15, x = 16\}, c = 17, x = 18\}, d = 19, x = 20\}\r\n$prompt $" {
  838.         incr passcount
  839.     }
  840.     -re ".* = \{B = \{A = \{a = 11, x = 12\}, b = 13, x = 14\}, C = \{A = \{a = 15, x = 16\}, c = 17, x = 18\}, d = 19, x = 20\}\r\n$prompt $" {
  841.         setup_xfail "*-*-*"
  842.         fail "print g_D"
  843.     }
  844.     -re ".*$prompt $" { fail "print g_D" }
  845.     timeout { fail "print g_D (timeout)" ; return }
  846.     }
  847.  
  848.     # Print all members of g_E.
  849.  
  850.     send "print g_E\n"
  851.     expect {
  852.     -re ".* = \{\<D\> = \{\<B\> = \{\<A\> = \{a = 21, x = 22\}, b = 23, x = 24\}, \<C\> = \{\<A\> = \{a = 25, x = 26\}, c = 27, x = 28\}, d = 29, x = 30\}, e = 31, x = 32\}\r\n$prompt $" {
  853.         incr passcount
  854.     }
  855.     -re ".* = \{D = \{B = \{A = \{a = 21, x = 22\}, b = 23, x = 24\}, C = \{A = \{a = 25, x = 26\}, c = 27, x = 28\}, d = 29, x = 30\}, e = 31, x = 32\}\r\n$prompt $" {
  856.         setup_xfail "*-*-*"
  857.         fail "print g_E"
  858.     }
  859.     -re ".*$prompt $" { fail "print g_E" }
  860.     timeout { fail "print g_E (timeout)" ; return }
  861.     }
  862.  
  863.     if $passcount then { 
  864.     pass "$passcount correct mi classes printed"
  865.     }
  866. }
  867.  
  868. #
  869. # Single virtual inheritance, print individual members.
  870. #
  871.  
  872. proc test_print_svi_members {} {
  873.     global prompt
  874.     global decimal
  875.  
  876.     set passcount 0
  877.  
  878.     # Print all members of g_vA.
  879.  
  880.     send "print g_vA.vA::va\n"
  881.     expect {
  882.     -re ".* = 1\r\n$prompt $" { incr passcount }
  883.     -re ".*$prompt $" { fail "print g_vA.vA::va" }
  884.     timeout { fail "print g_vA.vA::va (timeout)" ; return }
  885.     }
  886.  
  887.     send "print g_vA.vA::vx\n"
  888.     expect {
  889.     -re ".* = 2\r\n$prompt $" { incr passcount }
  890.     -re ".*$prompt $" { fail "print g_vA.vA::vx" }
  891.     timeout { fail "print g_vA.vA::vx (timeout)" ; return }
  892.     }
  893.  
  894.     # Print members of g_vA using compact form.
  895.  
  896.     send "print g_vA.va\n"
  897.     expect {
  898.     -re ".* = 1\r\n$prompt $" { incr passcount }
  899.     -re ".*$prompt $" { fail "print g_vA.va" }
  900.     timeout { fail "print g_vA.va (timeout)" ; return }
  901.     }
  902.  
  903.     send "print g_vA.vx\n"
  904.     expect {
  905.     -re ".* = 2\r\n$prompt $" { incr passcount }
  906.     -re ".*$prompt $" { fail "print g_vA.vx" }
  907.     timeout { fail "print g_vA.vx (timeout)" ; return }
  908.     }
  909.  
  910.     # Print all members of g_vB.
  911.  
  912.     send "print g_vB.vA::va\n"
  913.     expect {
  914.     -re ".* = 3\r\n$prompt $" { incr passcount }
  915.     -re ".* = $decimal\r\n$prompt $" {
  916.         # Treated virtual base class pointer as field
  917.         setup_xfail "*-*-*"
  918.         fail "print g_vB.vA::va"
  919.     }
  920.     -re ".*$prompt $" { fail "print g_vB.vA::va" }
  921.     timeout { fail "print g_vB.vA::va (timeout)" ; return }
  922.     }
  923.  
  924.     send "print g_vB.vA::vx\n"
  925.     expect {
  926.     -re ".* = 4\r\n$prompt $" { incr passcount }
  927.     -re ".* = 5\r\n$prompt $" {
  928.         # Didn't follow virtual base class pointer
  929.         setup_xfail "*-*-*"
  930.         fail "print g_vB.vA::vx"
  931.     }
  932.     -re ".*$prompt $" { fail "print g_vB.vA::vx" }
  933.     timeout { fail "print g_vB.vA::vx (timeout)" ; return }
  934.     }
  935.  
  936.     send "print g_vB.vB::vb\n"
  937.     expect {
  938.     -re ".* = 5\r\n$prompt $" { incr passcount }
  939.     -re ".*$prompt $" { fail "print g_vB.vB::vb" }
  940.     timeout { fail "print g_vB.vB::vb (timeout)" ; return }
  941.     }
  942.  
  943.     send "print g_vB.vB::vx\n"
  944.     expect {
  945.     -re ".* = 6\r\n$prompt $" { incr passcount }
  946.     -re ".*$prompt $" { fail "print g_vB.vB::vx" }
  947.     timeout { fail "print g_vB.vB::vx (timeout)" ; return }
  948.     }
  949.  
  950.     # Print members of g_vB using compact form.
  951.  
  952.     send "print g_vB.va\n"
  953.     expect {
  954.     -re ".* = 3\r\n$prompt $" { incr passcount }
  955.     -re "There is no member named va.*$prompt $" {
  956.         setup_xfail "*-*-*"
  957.         fail "print g_vB.va"
  958.     }
  959.     -re ".*$prompt $" { fail "print g_vB.va" }
  960.     timeout { fail "print g_vB.va (timeout)" ; return }
  961.     }
  962.  
  963.     send "print g_vB.vb\n"
  964.     expect {
  965.     -re ".* = 5\r\n$prompt $" { incr passcount }
  966.     -re ".*$prompt $" { fail "print g_vB.vb" }
  967.     timeout { fail "print g_vB.vb (timeout)" ; return }
  968.     }
  969.  
  970.     send "print g_vB.vx\n"
  971.     expect {
  972.     -re ".* = 6\r\n$prompt $" { incr passcount }
  973.     -re ".*$prompt $" { fail "print g_vB.vx" }
  974.     timeout { fail "print g_vB.vx (timeout)" ; return }
  975.     }
  976.  
  977.     # Print all members of g_vC.
  978.  
  979.     send "print g_vC.vA::va\n"
  980.     expect {
  981.     -re ".* = 7\r\n$prompt $" { incr passcount }
  982.     -re ".* = $decimal\r\n$prompt $" {
  983.         # Treated virtual base class pointer as field
  984.         setup_xfail "*-*-*"
  985.         fail "print g_vC.vA::va"
  986.     }
  987.     -re ".*$prompt $" { fail "print g_vC.vA::va" }
  988.     timeout { fail "print g_vC.vA::va (timeout)" ; return }
  989.     }
  990.  
  991.     send "print g_vC.vA::vx\n"
  992.     expect {
  993.     -re ".* = 8\r\n$prompt $" { incr passcount }
  994.     -re ".* = 9\r\n$prompt $" {
  995.         # Didn't follow virtual base class pointer
  996.         setup_xfail "*-*-*"
  997.         fail "print g_vC.vA::vx"
  998.     }
  999.     -re ".*$prompt $" { fail "print g_vC.vA::vx" }
  1000.     timeout { fail "print g_vC.vA::vx (timeout)" ; return }
  1001.     }
  1002.  
  1003.     send "print g_vC.vC::vc\n"
  1004.     expect {
  1005.     -re ".* = 9\r\n$prompt $" { incr passcount }
  1006.     -re ".*$prompt $" { fail "print g_vC.vC::vc" }
  1007.     timeout { fail "print g_vC.vC::vc (timeout)" ; return }
  1008.     }
  1009.  
  1010.     send "print g_vC.vC::vx\n"
  1011.     expect {
  1012.     -re ".* = 10\r\n$prompt $" { incr passcount }
  1013.     -re ".*$prompt $" { fail "print g_vC.vC::vx" }
  1014.     timeout { fail "print g_vC.vC::vx (timeout)" ; return }
  1015.     }
  1016.  
  1017.     # Print members of g_vC using compact form.
  1018.  
  1019.     send "print g_vC.va\n"
  1020.     expect {
  1021.     -re ".* = 7\r\n$prompt $" { incr passcount }
  1022.     -re "There is no member named va.*$prompt $" {
  1023.         setup_xfail "*-*-*"
  1024.         fail "print g_vC.va"
  1025.     }
  1026.     -re ".*$prompt $" { fail "print g_vC.va" }
  1027.     timeout { fail "print g_vC.va (timeout)" ; return }
  1028.     }
  1029.  
  1030.     send "print g_vC.vc\n"
  1031.     expect {
  1032.     -re ".* = 9\r\n$prompt $" { incr passcount }
  1033.     -re ".*$prompt $" { fail "print g_vC.vc" }
  1034.     timeout { fail "print g_vC.vc (timeout)" ; return }
  1035.     }
  1036.  
  1037.     send "print g_vC.vx\n"
  1038.     expect {
  1039.     -re ".* = 10\r\n$prompt $" { incr passcount }
  1040.     -re ".*$prompt $" { fail "print g_vC.vx" }
  1041.     timeout { fail "print g_vC.vx (timeout)" ; return }
  1042.     }
  1043.  
  1044.     if $passcount then {
  1045.     pass "$passcount correct svi members printed"
  1046.     }
  1047. }
  1048.  
  1049. #
  1050. # Single virtual inheritance, print type definitions.
  1051. #
  1052.  
  1053. proc test_ptype_vi {} {
  1054.     global prompt
  1055.  
  1056.     set passcount 0
  1057.  
  1058.     setup_xfail "*-*-*"
  1059.     send "ptype vA\n"
  1060.     expect {
  1061.     -re "type = class vA \{\r\n\[ \]*public:\r\n\[ \]*int va;\r\n\[ \]*int vx;\r\n\}\r\n$prompt $" {
  1062.         incr passcount
  1063.     }
  1064.     -re "type = struct vA \{\r\n\[ \]*int va;\r\n\[ \]*int vx;\r\n\}\r\n$prompt $" {
  1065.         fail "ptype vA (FIXME)"
  1066.     }
  1067.     -re ".*$prompt $" { fail "ptype vA" }
  1068.     timeout { fail "ptype vA (timeout)" ; return }
  1069.     }
  1070.  
  1071.     setup_xfail "*-*-*"
  1072.     send "ptype class vA\n"
  1073.     expect {
  1074.     -re "type = class vA \{\r\n\[ \]*public:\r\n\[ \]*int va;\r\n\[ \]*int vx;\r\n\}\r\n$prompt $" {
  1075.         incr passcount
  1076.     }
  1077.     -re "type = struct vA \{\r\n\[ \]*int va;\r\n\[ \]*int vx;\r\n\}\r\n$prompt $" {
  1078.         fail "ptype class vA (FIXME)"
  1079.     }
  1080.     -re ".*$prompt $" { fail "ptype class vA" }
  1081.     timeout { fail "ptype class vA (timeout)" ; return }
  1082.     }
  1083.  
  1084.     setup_xfail "*-*-*"
  1085.     send "ptype g_vA\n"
  1086.     expect {
  1087.     -re "type = class vA \{\r\n\[ \]*public:\r\n\[ \]*int va;\r\n\[ \]*int vx;\r\n\}\r\n$prompt $" {
  1088.         incr passcount
  1089.     }
  1090.     -re "type = struct vA \{\r\n\[ \]*int va;\r\n\[ \]*int vx;\r\n\}\r\n$prompt $" {
  1091.         fail "ptype g_vA (FIXME)"
  1092.     }
  1093.     -re ".*$prompt $" { fail "ptype g_vA" }
  1094.     timeout { fail "ptype g_vA (timeout)" ; return }
  1095.     }
  1096.  
  1097.     send "ptype vB\n"
  1098.     expect {
  1099.     -re "type = class vB : public virtual vA \{\r\n\[ \]*private:\r\n\[ \]*vA \*_vb\[\\\$\.\]vA;\r\n\[ \]*public:\r\n\[ \]*int vb;\r\n\[ \]*int vx;\r\n\}\r\n$prompt $" {
  1100.         incr passcount
  1101.     }
  1102.     -re "type = struct vB \{\r\n\[ \]*struct vA vA;\r\n\[ \]*struct vA \*_vb\[\\\$\.\]vA;\r\n\[ \]*int vb;\r\n\[ \]*int vx;\r\n\}\r\n$prompt $" {
  1103.         setup_xfail "*-*-*"
  1104.         fail "ptype vB"
  1105.     }
  1106.     -re ".*$prompt $" { fail "ptype vB" }
  1107.     timeout { fail "ptype vB (timeout)" ; return }
  1108.     }
  1109.  
  1110.     send "ptype class vB\n"
  1111.     expect {
  1112.     -re "type = class vB : public virtual vA \{\r\n\[ \]*private:\r\n\[ \]*vA \*_vb\[\\\$\.\]vA;\r\n\[ \]*public:\r\n\[ \]*int vb;\r\n\[ \]*int vx;\r\n\}\r\n$prompt $" {
  1113.         incr passcount
  1114.     }
  1115.     -re "type = struct vB \{\r\n\[ \]*struct vA vA;\r\n\[ \]*struct vA \*_vb\[\\\$\.\]vA;\r\n\[ \]*int vb;\r\n\[ \]*int vx;\r\n\}\r\n$prompt $" {
  1116.         setup_xfail "*-*-*"
  1117.         fail "ptype class vB"
  1118.     }
  1119.     -re ".*$prompt $" { fail "ptype class vB" }
  1120.     timeout { fail "ptype class vB (timeout)" ; return }
  1121.     }
  1122.  
  1123.     send "ptype g_vB\n"
  1124.     expect {
  1125.     -re "type = class vB : public virtual vA \{\r\n\[ \]*private:\r\n\[ \]*vA \*_vb\[\\\$\.\]vA;\r\n\[ \]*public:\r\n\[ \]*int vb;\r\n\[ \]*int vx;\r\n\}\r\n$prompt $" {
  1126.         incr passcount
  1127.     }
  1128.     -re "type = struct vB \{\r\n\[ \]*struct vA vA;\r\n\[ \]*struct vA \*_vb\[\\\$\.\]vA;\r\n\[ \]*int vb;\r\n\[ \]*int vx;\r\n\}\r\n$prompt $" {
  1129.         setup_xfail "*-*-*"
  1130.         fail "ptype g_vB"
  1131.     }
  1132.     -re ".*$prompt $" { fail "ptype g_vB" }
  1133.     timeout { fail "ptype g_vB (timeout)" ; return }
  1134.     }
  1135.  
  1136.     send "ptype vC\n"
  1137.     expect {
  1138.     -re "type = class vC : public virtual vA \{\r\n\[ \]*private:\r\n\[ \]*vA \*_vb\[\\\$\.\]vA;\r\n\[ \]*public:\r\n\[ \]*int vc;\r\n\[ \]*int vx;\r\n\}\r\n$prompt $" {
  1139.     }
  1140.     -re "type = struct vC \{\r\n\[ \]*struct vA vA;\r\n\[ \]*struct vA \*_vb\[\\\$\.\]vA;\r\n\[ \]*int vc;\r\n\[ \]*int vx;\r\n\}\r\n$prompt $" {
  1141.         setup_xfail "*-*-*"
  1142.         fail "ptype vC"
  1143.     }
  1144.     -re ".*$prompt $" { fail "ptype vC" }
  1145.     timeout { fail "ptype vC (timeout)" ; return }
  1146.     }
  1147.  
  1148.     send "ptype class vC\n"
  1149.     expect {
  1150.     -re "type = class vC : public virtual vA \{\r\n\[ \]*private:\r\n\[ \]*vA \*_vb\[\\\$\.\]vA;\r\n\[ \]*public:\r\n\[ \]*int vc;\r\n\[ \]*int vx;\r\n\}\r\n$prompt $" {
  1151.     }
  1152.     -re "type = struct vC \{\r\n\[ \]*struct vA vA;\r\n\[ \]*struct vA \*_vb\[\\\$\.\]vA;\r\n\[ \]*int vc;\r\n\[ \]*int vx;\r\n\}\r\n$prompt $" {
  1153.         setup_xfail "*-*-*"
  1154.         fail "ptype class vC"
  1155.     }
  1156.     -re ".*$prompt $" { fail "ptype class vC" }
  1157.     timeout { fail "ptype class vC (timeout)" ; return }
  1158.     }
  1159.  
  1160.     send "ptype g_vC\n"
  1161.     expect {
  1162.     -re "type = class vC : public virtual vA \{\r\n\[ \]*private:\r\n\[ \]*vA \*_vb\[\\\$\.\]vA;\r\n\[ \]*public:\r\n\[ \]*int vc;\r\n\[ \]*int vx;\r\n\}\r\n$prompt $" {
  1163.     }
  1164.     -re "type = struct vC \{\r\n\[ \]*struct vA vA;\r\n\[ \]*struct vA \*_vb\[\\\$\.\]vA;\r\n\[ \]*int vc;\r\n\[ \]*int vx;\r\n\}\r\n$prompt $" {
  1165.         setup_xfail "*-*-*"
  1166.         fail "ptype g_vC"
  1167.     }
  1168.     -re ".*$prompt $" { fail "ptype g_vC" }
  1169.     timeout { fail "ptype g_vC (timeout)" ; return }
  1170.     }
  1171.  
  1172.     if $passcount then {
  1173.     pass "$passcount correct svi types printed"
  1174.     }
  1175. }
  1176.  
  1177. #
  1178. # Single virtual inheritance, print complete classes.
  1179. #
  1180.  
  1181. proc test_print_svi_classes {} {
  1182.     global prompt
  1183.     global hex
  1184.     global decimal
  1185.  
  1186.     set passcount 0
  1187.  
  1188.     # Print all members of g_vA.
  1189.  
  1190.     send "print g_vA\n"
  1191.     expect {
  1192.     -re ".* = \{va = 1, vx = 2\}\r\n$prompt $" {
  1193.         incr passcount
  1194.     }
  1195.     -re ".*$prompt $" { fail "print g_vA" }
  1196.     timeout { fail "print g_vA (timeout)" ; return }
  1197.     }
  1198.  
  1199.     # Print all members of g_vB.
  1200.  
  1201.     send "print g_vB\n"
  1202.     expect {
  1203.     -re ".* = \{\<vA\> = \{va = 3, vx = 4\}, _vb\[\\\$\.\]vA = $hex, vb = 5, vx = 6\}\r\n$prompt $" {
  1204.         incr passcount
  1205.     }
  1206.     -re ".* = \{vA = \{va = $decimal, vx = 5\}, _vb\[\\\$\.\]vA = $hex, vb = 5, vx = 6\}\r\n$prompt $" {
  1207.         setup_xfail "*-*-*"
  1208.         fail "printt g_vB"
  1209.     }
  1210.     -re ".*$prompt $" { fail "print g_vB" }
  1211.     timeout { fail "print g_vB (timeout)" ; return }
  1212.     }
  1213.  
  1214.     # Print all members of g_vC.
  1215.  
  1216.     send "print g_vC\n"
  1217.     expect {
  1218.     -re ".* = \{\<vA\> = \{va = 7, vx = 8\}, _vb\[\\\$\.\]vA = $hex, vc = 9, vx = 10\}\r\n$prompt $" {
  1219.         incr passcount
  1220.     }
  1221.     -re ".* = \{vA = \{va = $decimal, vx = 9\}, _vb\[\\\$\.\]vA = $hex, vc = 9, vx = 10\}\r\n$prompt $" {
  1222.         setup_xfail "*-*-*"
  1223.         fail "print g_vC"
  1224.     }
  1225.     -re ".*$prompt $" { fail "print g_vC" }
  1226.     timeout { fail "print g_vC (timeout)" ; return }
  1227.     }
  1228.  
  1229.     if $passcount then {
  1230.     pass "$passcount correct svi classes printed"
  1231.     }
  1232. }
  1233.  
  1234. #
  1235. # Multiple virtual inheritance, print individual members.
  1236. #
  1237.  
  1238. proc test_print_mvi_members {} {
  1239.     global prompt
  1240.     global decimal
  1241.  
  1242.     set passcount 0
  1243.  
  1244.     # Print all members of g_vD.
  1245.  
  1246.     send "print g_vD.vA::va\n"
  1247.     expect {
  1248.     -re ".* = 19\r\n$prompt $" { incr passcount }
  1249.     -re ".* = $decimal\r\n$prompt $" {
  1250.         # Didn't follow virtual base class pointer
  1251.         setup_xfail "*-*-*"
  1252.         fail "print g_vD.vA::va"
  1253.     }
  1254.     -re ".*$prompt $" { fail "print g_vD.vA::va" }
  1255.     timeout { fail "print g_vD.vA::va (timeout)" ; return }
  1256.     }
  1257.  
  1258.     send "print g_vD.vA::vx\n"
  1259.     expect {
  1260.     -re ".* = 20\r\n$prompt $" { incr passcount }
  1261.     -re ".* = $decimal\r\n$prompt $" {
  1262.         # Didn't follow virtual base class pointer
  1263.         setup_xfail "*-*-*"
  1264.         fail "print g_vD.vA::vx"
  1265.     }
  1266.     -re ".*$prompt $" { fail "print g_vD.vA::vx" }
  1267.     timeout { fail "print g_vD.vA::vx (timeout)" ; return }
  1268.     }
  1269.  
  1270.     send "print g_vD.vB::vb\n"
  1271.     expect {
  1272.     -re ".* = 21\r\n$prompt $" { incr passcount }
  1273.     -re ".* = $decimal\r\n$prompt $" {
  1274.         # Didn't follow virtual base class pointer
  1275.         setup_xfail "*-*-*"
  1276.         fail "print g_vD.vB::vb"
  1277.     }
  1278.     -re ".*$prompt $" { fail "print g_vD.vB::vb" }
  1279.     timeout { fail "print g_vD.vB::vb (timeout)" ; return }
  1280.     }
  1281.  
  1282.     send "print g_vD.vB::vx\n"
  1283.     expect {
  1284.     -re ".* = 22\r\n$prompt $" { incr passcount }
  1285.     -re ".* = 25\r\n$prompt $" {
  1286.         # Didn't follow virtual base class pointer
  1287.         setup_xfail "*-*-*"
  1288.         fail "print g_vD.vB::vx"
  1289.     }
  1290.     -re ".*$prompt $" { fail "print g_vD.vB::vx" }
  1291.     timeout { fail "print g_vD.vB::vx (timeout)" ; return }
  1292.     }
  1293.  
  1294.     send "print g_vD.vC::vc\n"
  1295.     expect {
  1296.     -re ".* = 23\r\n$prompt $" { incr passcount }
  1297.     -re ".* = $decimal\r\n$prompt $" {
  1298.         # Didn't follow virtual base class pointer
  1299.         setup_xfail "*-*-*"
  1300.         fail "print g_vD.vC::vc"
  1301.     }
  1302.     -re ".*$prompt $" { fail "print g_vD.vC::vc" }
  1303.     timeout { fail "print g_vD.vC::vc (timeout)" ; return }
  1304.     }
  1305.  
  1306.     send "print g_vD.vC::vx\n"
  1307.     expect {
  1308.     -re ".* = 24\r\n$prompt $" { incr passcount }
  1309.     -re ".* = 25\r\n$prompt $" {
  1310.         # Didn't follow virtual base class pointer
  1311.         setup_xfail "*-*-*"
  1312.         fail "print g_vD.vC::vx"
  1313.     }
  1314.     -re ".*$prompt $" { fail "print g_vD.vC::vx" }
  1315.     timeout { fail "print g_vD.vC::vx (timeout)" ; return }
  1316.     }
  1317.  
  1318.     send "print g_vD.vD::vd\n"
  1319.     expect {
  1320.     -re ".* = 25\r\n$prompt $" { incr passcount }
  1321.     -re ".*$prompt $" { fail "print g_vD.vD::vd" }
  1322.     timeout { fail "print g_vD.vD::vd (timeout)" ; return }
  1323.     }
  1324.  
  1325.     send "print g_vD.vD::vx\n"
  1326.     expect {
  1327.     -re ".* = 26\r\n$prompt $" { incr passcount }
  1328.     -re ".*$prompt $" { fail "print g_vD.vD::vx" }
  1329.     timeout { fail "print g_vD.vD::vx (timeout)" ; return }
  1330.     }
  1331.  
  1332.     # Print all members of g_vE.
  1333.  
  1334.     send "print g_vE.vA::va\n"
  1335.     expect {
  1336.     -re ".* = 0\r\n$prompt $" { incr passcount }
  1337.     -re ".* = $decimal\r\n$prompt $" {
  1338.         # Didn't follow virtual base class pointer
  1339.         setup_xfail "*-*-*"
  1340.         fail "print g_vE.vA::va"
  1341.     }
  1342.     -re ".*$prompt $" { fail "print g_vE.vA::va" }
  1343.     timeout { fail "print g_vE.vA::va (timeout)" ; return }
  1344.     }
  1345.  
  1346.     send "print g_vE.vA::vx\n"
  1347.     expect {
  1348.     -re ".* = 0\r\n$prompt $" { incr passcount }
  1349.     -re ".* = 27\r\n$prompt $" {
  1350.         # Didn't follow virtual base class pointer
  1351.         setup_xfail "*-*-*"
  1352.         fail "print g_vE.vA::vx"
  1353.     }
  1354.     -re ".*$prompt $" { fail "print g_vE.vA::vx" }
  1355.     timeout { fail "print g_vE.vA::vx (timeout)" ; return }
  1356.     }
  1357.  
  1358.     send "print g_vE.vB::vb\n"
  1359.     expect {
  1360.     -re ".* = 0\r\n$prompt $" { incr passcount }
  1361.     -re ".* = 27\r\n$prompt $" {
  1362.         # Didn't follow virtual base class pointer
  1363.         setup_xfail "*-*-*"
  1364.         fail "print g_vE.vB::vb"
  1365.     }
  1366.     -re ".*$prompt $" { fail "print g_vE.vB::vb" }
  1367.     timeout { fail "print g_vE.vB::vb (timeout)" ; return }
  1368.     }
  1369.  
  1370.     send "print g_vE.vB::vx\n"
  1371.     expect {
  1372.     -re ".* = 0\r\n$prompt $" { incr passcount }
  1373.     -re ".* = 28\r\n$prompt $" {
  1374.         # Didn't follow virtual base class pointer
  1375.         setup_xfail "*-*-*"
  1376.         fail "print g_vE.vB::vx"
  1377.     }
  1378.     -re ".*$prompt $" { fail "print g_vE.vB::vx" }
  1379.     timeout { fail "print g_vE.vB::vx (timeout)" ; return }
  1380.     }
  1381.  
  1382.     send "print g_vE.vC::vc\n"
  1383.     expect {
  1384.     -re ".* = 0\r\n$prompt $" { incr passcount }
  1385.     -re ".* = 27\r\n$prompt $" {
  1386.         # Didn't follow virtual base class pointer
  1387.         setup_xfail "*-*-*"
  1388.         fail "print g_vE.vC::vc"
  1389.     }
  1390.     -re ".*$prompt $" { fail "print g_vE.vC::vc" }
  1391.     timeout { fail "print g_vE.vC::vc (timeout)" ; return }
  1392.     }
  1393.  
  1394.     send "print g_vE.vC::vx\n"
  1395.     expect {
  1396.     -re ".* = 0\r\n$prompt $" { incr passcount }
  1397.     -re ".* = 28\r\n$prompt $" {
  1398.         # Didn't follow virtual base class pointer
  1399.         setup_xfail "*-*-*"
  1400.         fail "print g_vE.vC::vx"
  1401.     }
  1402.     -re ".*$prompt $" { fail "print g_vE.vC::vx" }
  1403.     timeout { fail "print g_vE.vC::vx (timeout)" ; return }
  1404.     }
  1405.  
  1406.     send "print g_vE.vD::vd\n"
  1407.     expect {
  1408.     -re ".* = 0\r\n$prompt $" { incr passcount }
  1409.     -re ".* = 28\r\n$prompt $" {
  1410.         # Didn't follow virtual base class pointer
  1411.         setup_xfail "*-*-*"
  1412.         fail "print g_vE.vD::vd"
  1413.     }
  1414.     -re ".*$prompt $" { fail "print g_vE.vD::vd" }
  1415.     timeout { fail "print g_vE.vD::vd (timeout)" ; return }
  1416.     }
  1417.  
  1418.     send "print g_vE.vD::vx\n"
  1419.     expect {
  1420.     -re ".* = 0\r\n$prompt $" { incr passcount }
  1421.     -re ".*$prompt $" { fail "print g_vE.vD::vx" }
  1422.     timeout { fail "print g_vE.vD::vx (timeout)" ; return }
  1423.     }
  1424.  
  1425.     send "print g_vE.vE::ve\n"
  1426.     expect {
  1427.     -re ".* = 27\r\n$prompt $" { incr passcount }
  1428.     -re ".*$prompt $" { fail "print g_vE.vE::ve" }
  1429.     timeout { fail "print g_vE.vE::ve (timeout)" ; return }
  1430.     }
  1431.  
  1432.     send "print g_vE.vE::vx\n"
  1433.     expect {
  1434.     -re ".* = 28\r\n$prompt $" { incr passcount }
  1435.     -re ".*$prompt $" { fail "print g_vE.vE::vx" }
  1436.     timeout { fail "print g_vE.vE::vx (timeout)" ; return }
  1437.     }
  1438.  
  1439.     if $passcount then {
  1440.     pass "$passcount correct mvi members printed"
  1441.     }
  1442. }
  1443.  
  1444. #
  1445. # Multiple virtual inheritance, print type definitions.
  1446. #
  1447.  
  1448. proc test_ptype_mvi {} {
  1449.     global prompt
  1450.  
  1451.     set passcount 0
  1452.  
  1453.     send "ptype vD\n"
  1454.     expect {
  1455.     -re "type = class vD : public virtual vB, public virtual vC \{\r\n\[ \]*private:\r\n\[ \]*vC \*_vb\[\\\$\.\]vC;\r\n\[ \]*vB \*_vb\[\\\$\.\]vB;\r\n\[ \]*public:\r\n\[ \]*int vd;\r\n\[ \]*int vx;\r\n\}\r\n$prompt $" {
  1456.         incr passcount
  1457.     }
  1458.     -re "type = struct vD \{\r\n\[ \]*struct vB vB;\r\n\[ \]*struct vC vC;\r\n\[ \]*struct vC \*_vb\[\\\$\.\]vC;\r\n\[ \]*struct vB \*_vb\[\\\$\.\]vB;\r\n\[ \]*int vd;\r\n\[ \]*int vx;\r\n\}\r\n$prompt $" {
  1459.         setup_xfail "*-*-*"
  1460.         fail "ptype vD"
  1461.     }
  1462.     -re ".*$prompt $" { fail "ptype vD" }
  1463.     timeout { fail "ptype vD (timeout)" ; return }
  1464.     }
  1465.  
  1466.     send "ptype class vD\n"
  1467.     expect {
  1468.     -re "type = class vD : public virtual vB, public virtual vC \{\r\n\[ \]*private:\r\n\[ \]*vC \*_vb\[\\\$\.\]vC;\r\n\[ \]*vB \*_vb\[\\\$\.\]vB;\r\n\[ \]*public:\r\n\[ \]*int vd;\r\n\[ \]*int vx;\r\n\}\r\n$prompt $" {
  1469.         incr passcount
  1470.     }
  1471.     -re "type = struct vD \{\r\n\[ \]*struct vB vB;\r\n\[ \]*struct vC vC;\r\n\[ \]*struct vC \*_vb\[\\\$\.\]vC;\r\n\[ \]*struct vB \*_vb\[\\\$\.\]vB;\r\n\[ \]*int vd;\r\n\[ \]*int vx;\r\n\}\r\n$prompt $" {
  1472.         setup_xfail "*-*-*"
  1473.         fail "ptype class vD"
  1474.     }
  1475.     -re ".*$prompt $" { fail "ptype class vD" }
  1476.     timeout { fail "ptype class vD (timeout)" ; return }
  1477.     }
  1478.  
  1479.     send "ptype g_vD\n"
  1480.     expect {
  1481.     -re "type = class vD : public virtual vB, public virtual vC \{\r\n\[ \]*private:\r\n\[ \]*vC \*_vb\[\\\$\.\]vC;\r\n\[ \]*vB \*_vb\[\\\$\.\]vB;\r\n\[ \]*public:\r\n\[ \]*int vd;\r\n\[ \]*int vx;\r\n\}\r\n$prompt $" {
  1482.         incr passcount
  1483.     }
  1484.     -re "type = struct vD \{\r\n\[ \]*struct vB vB;\r\n\[ \]*struct vC vC;\r\n\[ \]*struct vC \*_vb\[\\\$\.\]vC;\r\n\[ \]*struct vB \*_vb\[\\\$\.\]vB;\r\n\[ \]*int vd;\r\n\[ \]*int vx;\r\n\}\r\n$prompt $" {
  1485.         setup_xfail "*-*-*"
  1486.         fail "ptype g_vD"
  1487.     }
  1488.     -re ".*$prompt $" { fail "ptype g_vD" }
  1489.     timeout { fail "ptype g_vD (timeout)" ; return }
  1490.     }
  1491.  
  1492.     send "ptype vE\n"
  1493.     expect {
  1494.     -re "type = class vE : public virtual vD \{\r\n\[ \]*private:\r\n\[ \]*vD \*_vb\[\\\$\.\]vD;\r\n\[ \]*public:\r\n\[ \]*int ve;\r\n\[ \]*int vx;\r\n\}\r\n$prompt $" {
  1495.         incr passcount
  1496.     }
  1497.     -re "type = struct vE \{\r\n\[ \]*struct vD vD;\r\n\[ \]*struct vD \*_vb\[\\\$\.\]vD;\r\n\[ \]*int ve;\r\n\[ \]*int vx;\r\n\}\r\n$prompt $" {
  1498.         setup_xfail "*-*-*"
  1499.         fail "ptype vE"
  1500.     }
  1501.     -re ".*$prompt $" { fail "ptype vE" }
  1502.     timeout { fail "ptype vE (timeout)" ; return }
  1503.     }
  1504.  
  1505.     send "ptype class vE\n"
  1506.     expect {
  1507.     -re "type = class vE : public virtual vD \{\r\n\[ \]*private:\r\n\[ \]*vD \*_vb\[\\\$\.\]vD;\r\n\[ \]*public:\r\n\[ \]*int ve;\r\n\[ \]*int vx;\r\n\}\r\n$prompt $" {
  1508.         incr passcount
  1509.     }
  1510.     -re "type = struct vE \{\r\n\[ \]*struct vD vD;\r\n\[ \]*struct vD \*_vb\[\\\$\.\]vD;\r\n\[ \]*int ve;\r\n\[ \]*int vx;\r\n\}\r\n$prompt $" {
  1511.         setup_xfail "*-*-*"
  1512.         fail "ptype class vE"
  1513.     }
  1514.     -re ".*$prompt $" { fail "ptype class vE" }
  1515.     timeout { fail "ptype class vE (timeout)" ; return }
  1516.     }
  1517.  
  1518.     send "ptype g_vE\n"
  1519.     expect {
  1520.     -re "type = class vE : public virtual vD \{\r\n\[ \]*private:\r\n\[ \]*vD \*_vb\[\\\$\.\]vD;\r\n\[ \]*public:\r\n\[ \]*int ve;\r\n\[ \]*int vx;\r\n\}\r\n$prompt $" {
  1521.         incr passcount
  1522.     }
  1523.     -re "type = struct vE \{\r\n\[ \]*struct vD vD;\r\n\[ \]*struct vD \*_vb\[\\\$\.\]vD;\r\n\[ \]*int ve;\r\n\[ \]*int vx;\r\n\}\r\n$prompt $" {
  1524.         setup_xfail "*-*-*"
  1525.         fail "ptype g_vE"
  1526.     }
  1527.     -re ".*$prompt $" { fail "ptype g_vE" }
  1528.     timeout { fail "ptype g_vE (timeout)" ; return }
  1529.     }
  1530.  
  1531.     if $passcount then {
  1532.     pass "$passcount correct mvi types printed"
  1533.     }
  1534. }
  1535.  
  1536. #
  1537. # Multiple virtual inheritance, print complete classes.
  1538. #
  1539.  
  1540. proc test_print_mvi_classes {} {
  1541.     global prompt
  1542.     global hex
  1543.     global decimal
  1544.  
  1545.     set passcount 0
  1546.  
  1547.     # Print all members of g_vD.
  1548.  
  1549.     send "print g_vD\n"
  1550.     expect {
  1551.     -re ".* = \{\<vB\> = \{\<vA\> = \{va = 19, vx = 20\}, _vb\[\\\$\.\]vA = $hex, vb = 21, vx = 22\}, \<vC\> = \{_vb\[\\\$\.\]vA = $hex, vc = 23, vx = 24\}, _vb\[\\\$\.\]vC = $hex, _vb\[\\\$\.\]vB = $hex, vd = 25, vx = 26\}\r\n$prompt $" {
  1552.         incr passcount
  1553.     }
  1554.     -re ".* = \{vB = \{vA = \{va = $decimal, vx = $decimal\}, _vb\[\\\$\.\]vA = $hex, vb = $decimal, vx = 25\}, vC = \{vA = \{va = $decimal, vx = $decimal\}, _vb\[\\\$\.\]vA = $hex, vc = $decimal, vx = 25\}, _vb\[\\\$\.\]vC = $hex, _vb\[\\\$\.\]vB = $hex, vd = 25, vx = 26\}\r\n$prompt $" {
  1555.         setup_xfail "*-*-*"
  1556.         fail "print g_vD"
  1557.     }
  1558.     -re ".*$prompt $" { fail "print g_vD" }
  1559.     timeout { fail "print g_vD (timeout)" ; return }
  1560.     }
  1561.  
  1562.     # Print all members of g_vE.
  1563.  
  1564.     send "print g_vE\n"
  1565.     expect {
  1566.     -re ".* = \{\<vD\> = \{\<vB\> = \{\<vA\> = \{va = 0, vx = 0\}, _vb\[\\\$\.\]vA = $hex, vb = 0, vx = 0\}, \<vC\> = \{_vb\[\\\$\.\]vA = $hex, vc = 0, vx = 0\}, _vb\[\\\$\.\]vC = $hex, _vb\[\\\$\.\]vB = $hex, vd = 0, vx = 0\}, _vb\[\\\$\.\]vD = $hex, ve = 27, vx = 28\}\r\n$prompt $" {
  1567.         incr passcount
  1568.     }
  1569.     -re ".* = \{vD = \{vB = \{vA = \{va = $decimal, vx = 27\}, _vb\[\\\$\.\]vA = $hex, vb = 27, vx = 28\}, vC = \{vA = \{va = $decimal, vx = 27\}, _vb\[\\\$\.\]vA = $hex, vc = 27, vx = 28\}, _vb\[\\\$\.\]vC = $hex, _vb\[\\\$\.\]vB = $hex, vd = 28, vx = 0\}, _vb\[\\\$\.\]vD = $hex, ve = 27, vx = 28\}\r\n$prompt $" {
  1570.         setup_xfail "*-*-*"
  1571.         fail "print g_vE"
  1572.     }
  1573.     -re ".*$prompt $" { fail "print g_vE" }
  1574.     timeout { fail "print g_vE (timeout)" ; return }
  1575.     }
  1576.  
  1577.     if $passcount then {
  1578.     pass "$passcount correct mvi classes printed"
  1579.     }
  1580. }
  1581.  
  1582. proc do_tests {} {
  1583.     global prms_id
  1584.     global bug_id
  1585.     global subdir
  1586.     global objdir
  1587.     global srcdir
  1588.     global binfile
  1589.     global prompt
  1590.  
  1591.     set prms_id 0
  1592.     set bug_id 0
  1593.  
  1594.     # Start with a fresh gdb.
  1595.  
  1596.     gdb_exit
  1597.     gdb_start
  1598.     gdb_reinitialize_dir $srcdir/$subdir
  1599.     gdb_load $objdir/$subdir/$binfile
  1600.  
  1601.     send "set language c++\n"
  1602.     expect -re "$prompt $"
  1603.     send "set width 0\n"
  1604.     expect -re "$prompt $"
  1605.  
  1606.     if [ runto main ] then {
  1607.     test_ptype_si
  1608.     test_ptype_mi
  1609.     test_ptype_vi
  1610.     test_ptype_mvi
  1611.     }
  1612.  
  1613.     if [istarget "a29k-*-udi"] then {
  1614.     # FIXME: If PR 2415 is fixed, this is not needed.
  1615.     gdb_target_udi
  1616.     gdb_load $objdir/$subdir/$binfile
  1617.     }
  1618.  
  1619.     if [ runto 'inheritance2(void)' ] then {
  1620.     test_print_si_members
  1621.     test_print_si_classes
  1622.     test_print_mi_members
  1623.     test_print_mi_classes
  1624.     }
  1625.  
  1626.     if [istarget "a29k-*-udi"] then {
  1627.     # FIXME: If PR 2415 is fixed, this is not needed.
  1628.     gdb_target_udi
  1629.     gdb_load $objdir/$subdir/$binfile
  1630.     }
  1631.  
  1632.     if [ runto 'inheritance4(void)' ] then {
  1633.     test_print_svi_members
  1634.     test_print_svi_classes
  1635.     test_print_mvi_members
  1636.     test_print_mvi_classes
  1637.     }
  1638.  
  1639.     if [istarget "a29k-*-udi"] then {
  1640.     # FIXME: If PR 2415 is fixed, this is not needed.
  1641.     gdb_target_udi
  1642.     }
  1643. }
  1644.  
  1645. # Check to see if we have an executable to test.  If not, then either we
  1646. # haven't tried to compile one, or the compilation failed for some reason.
  1647. # In either case, just notify the user and skip the tests in this file.
  1648.  
  1649. set binfile "gdbme"
  1650. set srcfile $binfile.cc
  1651.  
  1652. if ![file exists $objdir/$subdir/$binfile] then {
  1653.     warning "$binfile does not exist; tests suppressed."
  1654. } else {
  1655.     do_tests
  1656. }
  1657.