1 # Copyright 1992, 1994, 1995, 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004
2 # Free Software Foundation, Inc.
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2 of the License, or
7 # (at your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 # Please email any bugs, comments, and/or additions to this file to:
19 # bug-gdb@prep.ai.mit.edu
21 # This file was written by Fred Fish. (fnf@cygnus.com)
22 # And rewritten by Michael Chastain <mec.gnu@mindspring.com>.
24 set wsopt "\[\r\n\t \]*"
32 if { [skip_cplus_tests] } { continue }
34 set testfile "virtfunc"
35 set srcfile ${testfile}.cc
36 set binfile ${objdir}/${subdir}/${testfile}
38 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {c++ debug}] != "" } {
39 gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
42 # Test ptype of a class.
44 # Different C++ compilers produce different output. I build up regular
45 # expressions piece by piece to accommodate all the compilers that I
46 # have seen: gcc 2.95.3, gcc 3.3.2 (ABI 1), gcc 3.4 prerelease (ABI 2);
47 # and all the debug formats I have seen: dwarf-2 and stabs+.
49 # A complicated class declaration looks like this:
51 # class A : public virtual V { // re_class
53 # V * _vb$V; // re_vbptr
56 # public: // re_access_methods
57 # A & operator=(A const &); // re_synth_gcc_2
58 # A(int, A const &); // ...
60 # virtual int f(void); // re_methods
63 # RE_CLASS matches the class declaration. C++ allows multiple ways of
66 # struct ... { private: ... };
67 # class ... { private: ... };
70 # RE_VBPTR matches the virtual base declarations. gcc 2.95.3 sometimes
71 # emits these, but gcc 3.X.Y never emits these. The name depends on the
74 # RE_FIELDS matches the data fields of the class.
75 # RE_METHODS matches the methods explicitly declared for the class.
77 # RE_SYNTH_GCC_2 and RE_SYNTH_GCC_3 match the optional synthetic methods
78 # of the class. gcc -gstabs+ emits these methods, and gcc -gdwarf-2
81 # RE_ACCESS_METHODS is an access specifier after RE_FIELDS and before
82 # the methods (explicit methods and/or synthetic methods).
83 # There is also an RE_ACCESS_FIELDS.
85 # When I get HP-UX aCC, I hope that I can just add RE_SYNTH_ACC_NNN.
87 # Yet another twist: with gcc v2, ctor and dtor methods have a hidden
88 # argument in front, the "in-charge" flag. With gcc v3, there is no
89 # hidden argument; instead, there are multiple object functions for
92 # -- chastain 2004-01-01
94 # compatibility kludges
120 proc test_one_ptype { command testname re_class re_vbptr re_access_fields re_fields re_access_methods re_methods re_synth_gcc_2 re_synth_gcc_3 re_star } {
134 gdb_test_multiple "$command" "$testname" {
135 -re "type = $re_class${wsopt}$re_access_fields${wsopt}$re_fields${wsopt}$re_access_methods${wsopt}$re_methods$nl\}$re_star$nl$gdb_prompt $" {
136 # gcc 2.95.3, dwarf-2, no vbptr
137 # gcc 3.X, abi 1, dwarf-2
138 # gcc 3.X, abi 2, dwarf-2
141 -re "type = $re_class${wsopt}$re_vbptr${wsopt}$re_access_fields${wsopt}$re_fields${wsopt}$re_access_methods${wsopt}$re_methods$nl\}$re_star$nl$gdb_prompt $" {
142 # gcc 2.95.3, dwarf-2, vbptr
143 # TODO: drow says the vbptr is a bug
146 -re "type = $re_class${wsopt}$re_access_fields${wsopt}$re_fields${wsopt}$re_access_methods${wsopt}$re_synth_gcc_2${wsopt}$re_methods$nl\}$re_star$nl$gdb_prompt $" {
147 # gcc 2.95.3, stabs+, no vbptr
150 -re "type = $re_class${wsopt}$re_vbptr${wsopt}$re_access_fields${wsopt}$re_fields${wsopt}$re_access_methods${wsopt}$re_synth_gcc_2${wsopt}$re_methods$nl\}$re_star$nl$gdb_prompt $" {
151 # gcc 2.95.3, stabs+, vbptr
152 # TODO: drow says the vbptr is a bug
155 -re "type = $re_class${wsopt}$re_access_fields${wsopt}$re_fields${wsopt}$re_access_methods${wsopt}$re_synth_gcc_3${wsopt}$re_methods$nl\}$re_star$nl$gdb_prompt $" {
156 # gcc 3.X, abi 1, stabs+
159 -re "type = $re_class${wsopt}$re_access_fields${wsopt}$re_fields${wsopt}$re_access_methods${wsopt}$re_methods${wsopt}$re_synth_gcc_3$nl\}$re_star$nl$gdb_prompt $" {
160 # gcc 3.X, abi 2, stabs+
161 if { "$fk5" == "fail" } {
178 proc test_ptype_of_classes {} {
193 set kk0 " (obsolescent gcc or gdb)"
194 test_one_ptype "ptype VA" "ptype VA" \
195 "((struct|class) VA \{${ws}public:|struct VA \{)" \
199 "VA & operator=\\(VA const ?&\\);${ws}VA\\(VA const ?&\\);${ws}VA\\((void|)\\);" \
200 "VA & operator=\\(VA const ?&\\);${ws}VA\\(VA const ?&\\);${ws}VA\\((void|)\\);" \
205 set kk0 " (obsolescent gcc or gdb)"
206 set kk5 " (obsolescent gcc or gdb)"
207 test_one_ptype "ptype VB" "ptype VB" \
208 "((struct|class) VB \{${ws}public:|struct VB \{)" \
211 "" "int fvb\\((void|)\\);${ws}virtual int vvb\\((void|)\\);" \
212 "VB & operator=\\(VB const ?&\\);${ws}VB\\(VB const ?&\\);${ws}VB\\((void|)\\);" \
213 "VB & operator=\\(VB const ?&\\);${ws}VB\\(VB const ?&\\);${ws}VB\\((void|)\\);" \
218 set kk0 " (obsolescent gcc or gdb)"
219 set kk5 " (obsolescent gcc or gdb)"
220 test_one_ptype "ptype V" "ptype V" \
221 "class V : public VA, public VB \{${ws}public:" \
224 "" "int f\\((void|)\\);${ws}virtual int vv\\((void|)\\);" \
225 "V & operator=\\(V const ?&\\);${ws}V\\(V const ?&\\);${ws}V\\((void|)\\);" \
226 "V & operator=\\(V const ?&\\);${ws}V\\(V const ?&\\);${ws}V\\((void|)\\);" \
232 set kk1 " (obsolescent gcc or gdb)"
234 test_one_ptype "ptype A" "ptype A" \
235 "class A : public virtual V \{(${ws}private:|)" \
236 "V \\*(_vb.1V|_vb.V);" \
238 "public:" "virtual int f\\((void|)\\);" \
239 "A & operator=\\(A const ?&\\);${ws}A\\(int, A const ?&\\);${ws}A\\(int\\);" \
240 "A & operator=\\(A const ?&\\);${ws}A\\(A const ?&\\);${ws}A\\(\\);" \
245 set kk0 " (obsolescent gcc or gdb)"
247 test_one_ptype "ptype B" "ptype B" \
248 "class B : public A \{(${ws}private:|)" \
249 "V \\*(_vb.1V|_vb.V);" \
251 "public:" "virtual int f\\((void|)\\);" \
252 "B & operator=\\(B const ?&\\);${ws}B\\(int, B const ?&\\);${ws}B\\(int\\);" \
253 "B & operator=\\(B const ?&\\);${ws}B\\(B const ?&\\);${ws}B\\(\\);" \
259 set kk1 " (obsolescent gcc or gdb)"
260 test_one_ptype "ptype C" "ptype C" \
261 "class C : public virtual V \{(${ws}private:|)" \
262 "V \\*(_vb.1V|_vb.V);" \
265 "C & operator=\\(C const ?&\\);${ws}C\\(int, C const ?&\\);${ws}C\\(int\\);" \
266 "C & operator=\\(C const ?&\\);${ws}C\\(C const ?&\\);${ws}C\\(\\);" \
271 set kk0 " (obsolescent gcc or gdb)"
272 set kk5 " (obsolescent gcc or gdb)"
273 test_one_ptype "ptype AD" "ptype AD" \
274 "((struct|class) AD \{${ws}public:|struct AD \{)" \
277 "" "virtual int vg\\((void|)\\);" \
278 "AD & operator=\\(AD const ?&\\);${ws}AD\\(AD const ?&\\);${ws}AD\\((void|)\\);" \
279 "AD & operator=\\(AD const ?&\\);${ws}AD\\(AD const ?&\\);${ws}AD\\((void|)\\);" \
285 set kk1 " (obsolescent gcc or gdb)"
287 test_one_ptype "ptype D" "ptype D" \
288 "class D : public AD, public virtual V \{(${ws}private:|)" \
289 "V \\*(_vb.1V|_vb.V);" \
291 "" "static void s\\((void|)\\);${ws}virtual int vg\\((void|)\\);${ws}virtual int vd\\((void|)\\);${ws}int fd\\((void|)\\);" \
292 "D & operator=\\(D const ?&\\);${ws}D\\(int, D const ?&\\);${ws}D\\(int\\);" \
293 "D & operator=\\(D const ?&\\);${ws}D\\(D const ?&\\);${ws}D\\(\\);" \
297 # TODO: E does not show a vbptr for V. That seems strange.
299 set kk0 " (obsolescent gcc or gdb)"
301 test_one_ptype "ptype E" "ptype E" \
302 "class E : public B, public virtual V, public D, public C \{(${ws}private:|)" \
305 "" "virtual int f\\((void|)\\);${ws}virtual int vg\\((void|)\\);${ws}virtual int vv\\((void|)\\);" \
306 "E & operator=\\(E const ?&\\);${ws}E\\(int, E const ?&\\);${ws}E\\(int\\);" \
307 "E & operator=\\(E const ?&\\);${ws}E\\(E const ?&\\);${ws}E\\(\\);" \
313 set kk1 " (obsolescent gcc or gdb)"
315 test_one_ptype "ptype dd" "ptype dd" \
316 "class D : public AD, public virtual V \{(${ws}private:|)" \
317 "V \\*(_vb.1V|_vb.V);" \
319 "" "static void s\\((void|)\\);${ws}virtual int vg\\((void|)\\);${ws}virtual int vd\\((void|)\\);${ws}int fd\\((void|)\\);" \
320 "D & operator=\\(D const ?&\\);${ws}D\\(int, D const ?&\\);${ws}D\\(int\\);" \
321 "D & operator=\\(D const ?&\\);${ws}D\\(D const ?&\\);${ws}D\\(\\);" \
327 set kk1 " (obsolescent gcc or gdb)"
329 test_one_ptype "ptype ppd" "ptype ppd" \
330 "class D : public AD, public virtual V \{(${ws}private:|)" \
331 "V \\*(_vb.1V|_vb.V);" \
333 "" "static void s\\((void|)\\);${ws}virtual int vg\\((void|)\\);${ws}virtual int vd\\((void|)\\);${ws}int fd\\((void|)\\);" \
334 "D & operator=\\(D const ?&\\);${ws}D\\(int, D const ?&\\);${ws}D\\(int\\);" \
335 "D & operator=\\(D const ?&\\);${ws}D\\(D const ?&\\);${ws}D\\(\\);" \
338 # An instance of AD *
339 # TODO: this should be named pADd, not pAd.
341 set kk0 " (obsolescent gcc or gdb)"
342 set kk5 " (obsolescent gcc or gdb)"
343 test_one_ptype "ptype pAd" "ptype pAd" \
344 "((struct|class) AD \{${ws}public:|struct AD \{)" \
347 "" "virtual int vg\\((void|)\\);" \
348 "AD & operator=\\(AD const ?&\\);${ws}AD\\(AD const ?&\\);${ws}AD\\((void|)\\);" \
349 "AD & operator=\\(AD const ?&\\);${ws}AD\\(AD const ?&\\);${ws}AD\\((void|)\\);" \
355 set kk1 " (obsolescent gcc or gdb)"
357 test_one_ptype "ptype a" "ptype a" \
358 "class A : public virtual V \{(${ws}private:|)" \
359 "V \\*(_vb.1V|_vb.V);" \
361 "public:" "virtual int f\\((void|)\\);" \
362 "A & operator=\\(A const ?&\\);${ws}A\\(int, A const ?&\\);${ws}A\\(int\\);" \
363 "A & operator=\\(A const ?&\\);${ws}A\\(A const ?&\\);${ws}A\\(\\);" \
368 set kk0 " (obsolescent gcc or gdb)"
370 test_one_ptype "ptype b" "ptype b" \
371 "class B : public A \{(${ws}private:|)" \
372 "V \\*(_vb.1V|_vb.V);" \
374 "public:" "virtual int f\\((void|)\\);" \
375 "B & operator=\\(B const ?&\\);${ws}B\\(int, B const ?&\\);${ws}B\\(int\\);" \
376 "B & operator=\\(B const ?&\\);${ws}B\\(B const ?&\\);${ws}B\\(\\);" \
382 set kk1 " (obsolescent gcc or gdb)"
383 test_one_ptype "ptype c" "ptype c" \
384 "class C : public virtual V \{(${ws}private:|)" \
385 "V \\*(_vb.1V|_vb.V);" \
388 "C & operator=\\(C const ?&\\);${ws}C\\(int, C const ?&\\);${ws}C\\(int\\);" \
389 "C & operator=\\(C const ?&\\);${ws}C\\(C const ?&\\);${ws}C\\(\\);" \
395 set kk1 " (obsolescent gcc or gdb)"
397 test_one_ptype "ptype d" "ptype d" \
398 "class D : public AD, public virtual V \{(${ws}private:|)" \
399 "V \\*(_vb.1V|_vb.V);" \
401 "" "static void s\\((void|)\\);${ws}virtual int vg\\((void|)\\);${ws}virtual int vd\\((void|)\\);${ws}int fd\\((void|)\\);" \
402 "D & operator=\\(D const ?&\\);${ws}D\\(int, D const ?&\\);${ws}D\\(int\\);" \
403 "D & operator=\\(D const ?&\\);${ws}D\\(D const ?&\\);${ws}D\\(\\);" \
408 set kk0 " (obsolescent gcc or gdb)"
410 test_one_ptype "ptype e" "ptype e" \
411 "class E : public B, public virtual V, public D, public C \{(${ws}private:|)" \
414 "" "virtual int f\\((void|)\\);${ws}virtual int vg\\((void|)\\);${ws}virtual int vv\\((void|)\\);" \
415 "E & operator=\\(E const ?&\\);${ws}E\\(int, E const ?&\\);${ws}E\\(int\\);" \
416 "E & operator=\\(E const ?&\\);${ws}E\\(E const ?&\\);${ws}E\\(\\);" \
421 set kk0 " (obsolescent gcc or gdb)"
422 set kk5 " (obsolescent gcc or gdb)"
423 test_one_ptype "ptype v" "ptype v" \
424 "class V : public VA, public VB \{${ws}public:" \
427 "" "int f\\((void|)\\);${ws}virtual int vv\\((void|)\\);" \
428 "V & operator=\\(V const ?&\\);${ws}V\\(V const ?&\\);${ws}V\\((void|)\\);" \
429 "V & operator=\\(V const ?&\\);${ws}V\\(V const ?&\\);${ws}V\\((void|)\\);" \
434 set kk0 " (obsolescent gcc or gdb)"
435 set kk5 " (obsolescent gcc or gdb)"
436 test_one_ptype "ptype vb" "ptype vb" \
437 "((struct|class) VB \{${ws}public:|struct VB \{)" \
440 "" "int fvb\\((void|)\\);${ws}virtual int vvb\\((void|)\\);" \
441 "VB & operator=\\(VB const ?&\\);${ws}VB\\(VB const ?&\\);${ws}VB\\((void|)\\);" \
442 "VB & operator=\\(VB const ?&\\);${ws}VB\\(VB const ?&\\);${ws}VB\\((void|)\\);" \
448 set kk1 " (obsolescent gcc or gdb)"
450 test_one_ptype "ptype pAa" "ptype pAa" \
451 "class A : public virtual V \{(${ws}private:|)" \
452 "V \\*(_vb.1V|_vb.V);" \
454 "public:" "virtual int f\\((void|)\\);" \
455 "A & operator=\\(A const ?&\\);${ws}A\\(int, A const ?&\\);${ws}A\\(int\\);" \
456 "A & operator=\\(A const ?&\\);${ws}A\\(A const ?&\\);${ws}A\\(\\);" \
462 set kk1 " (obsolescent gcc or gdb)"
464 test_one_ptype "ptype pAe" "ptype pAe" \
465 "class A : public virtual V \{(${ws}private:|)" \
466 "V \\*(_vb.1V|_vb.V);" \
468 "public:" "virtual int f\\((void|)\\);" \
469 "A & operator=\\(A const ?&\\);${ws}A\\(int, A const ?&\\);${ws}A\\(int\\);" \
470 "A & operator=\\(A const ?&\\);${ws}A\\(A const ?&\\);${ws}A\\(\\);" \
475 set kk0 " (obsolescent gcc or gdb)"
477 test_one_ptype "ptype pBe" "ptype pBe" \
478 "class B : public A \{(${ws}private:|)" \
479 "V \\*(_vb.1V|_vb.V);" \
481 "public:" "virtual int f\\((void|)\\);" \
482 "B & operator=\\(B const ?&\\);${ws}B\\(int, B const ?&\\);${ws}B\\(int\\);" \
483 "B & operator=\\(B const ?&\\);${ws}B\\(B const ?&\\);${ws}B\\(\\);" \
489 set kk1 " (obsolescent gcc or gdb)"
491 test_one_ptype "ptype pDd" "ptype pDd" \
492 "class D : public AD, public virtual V \{(${ws}private:|)" \
493 "V \\*(_vb.1V|_vb.V);" \
495 "" "static void s\\((void|)\\);${ws}virtual int vg\\((void|)\\);${ws}virtual int vd\\((void|)\\);${ws}int fd\\((void|)\\);" \
496 "D & operator=\\(D const ?&\\);${ws}D\\(int, D const ?&\\);${ws}D\\(int\\);" \
497 "D & operator=\\(D const ?&\\);${ws}D\\(D const ?&\\);${ws}D\\(\\);" \
503 set kk1 " (obsolescent gcc or gdb)"
505 test_one_ptype "ptype pDe" "ptype pDe" \
506 "class D : public AD, public virtual V \{(${ws}private:|)" \
507 "V \\*(_vb.1V|_vb.V);" \
509 "" "static void s\\((void|)\\);${ws}virtual int vg\\((void|)\\);${ws}virtual int vd\\((void|)\\);${ws}int fd\\((void|)\\);" \
510 "D & operator=\\(D const ?&\\);${ws}D\\(int, D const ?&\\);${ws}D\\(int\\);" \
511 "D & operator=\\(D const ?&\\);${ws}D\\(D const ?&\\);${ws}D\\(\\);" \
516 set kk0 " (obsolescent gcc or gdb)"
517 set kk5 " (obsolescent gcc or gdb)"
518 test_one_ptype "ptype pVa" "ptype pVa" \
519 "class V : public VA, public VB \{${ws}public:" \
522 "" "int f\\((void|)\\);${ws}virtual int vv\\((void|)\\);" \
523 "V & operator=\\(V const ?&\\);${ws}V\\(V const ?&\\);${ws}V\\((void|)\\);" \
524 "V & operator=\\(V const ?&\\);${ws}V\\(V const ?&\\);${ws}V\\((void|)\\);" \
529 set kk0 " (obsolescent gcc or gdb)"
530 set kk5 " (obsolescent gcc or gdb)"
531 test_one_ptype "ptype pVv" "ptype pVv" \
532 "class V : public VA, public VB \{${ws}public:" \
535 "" "int f\\((void|)\\);${ws}virtual int vv\\((void|)\\);" \
536 "V & operator=\\(V const ?&\\);${ws}V\\(V const ?&\\);${ws}V\\((void|)\\);" \
537 "V & operator=\\(V const ?&\\);${ws}V\\(V const ?&\\);${ws}V\\((void|)\\);" \
542 set kk0 " (obsolescent gcc or gdb)"
543 set kk5 " (obsolescent gcc or gdb)"
544 test_one_ptype "ptype pVe" "ptype pVe" \
545 "class V : public VA, public VB \{${ws}public:" \
548 "" "int f\\((void|)\\);${ws}virtual int vv\\((void|)\\);" \
549 "V & operator=\\(V const ?&\\);${ws}V\\(V const ?&\\);${ws}V\\((void|)\\);" \
550 "V & operator=\\(V const ?&\\);${ws}V\\(V const ?&\\);${ws}V\\((void|)\\);" \
555 set kk0 " (obsolescent gcc or gdb)"
556 set kk5 " (obsolescent gcc or gdb)"
557 test_one_ptype "ptype pVd" "ptype pVd" \
558 "class V : public VA, public VB \{${ws}public:" \
561 "" "int f\\((void|)\\);${ws}virtual int vv\\((void|)\\);" \
562 "V & operator=\\(V const ?&\\);${ws}V\\(V const ?&\\);${ws}V\\((void|)\\);" \
563 "V & operator=\\(V const ?&\\);${ws}V\\(V const ?&\\);${ws}V\\((void|)\\);" \
566 # An instance of AD *
568 set kk0 " (obsolescent gcc or gdb)"
569 set kk5 " (obsolescent gcc or gdb)"
570 test_one_ptype "ptype pADe" "ptype pADe" \
571 "((struct|class) AD \{${ws}public:|struct AD \{)" \
574 "" "virtual int vg\\((void|)\\);" \
575 "AD & operator=\\(AD const ?&\\);${ws}AD\\(AD const ?&\\);${ws}AD\\((void|)\\);" \
576 "AD & operator=\\(AD const ?&\\);${ws}AD\\(AD const ?&\\);${ws}AD\\((void|)\\);" \
581 set kk0 " (obsolescent gcc or gdb)"
583 test_one_ptype "ptype pEe" "ptype pEe" \
584 "class E : public B, public virtual V, public D, public C \{(${ws}private:|)" \
587 "" "virtual int f\\((void|)\\);${ws}virtual int vg\\((void|)\\);${ws}virtual int vv\\((void|)\\);" \
588 "E & operator=\\(E const ?&\\);${ws}E\\(int, E const ?&\\);${ws}E\\(int\\);" \
589 "E & operator=\\(E const ?&\\);${ws}E\\(E const ?&\\);${ws}E\\(\\);" \
592 # An instance of VB *
594 set kk0 " (obsolescent gcc or gdb)"
595 set kk5 " (obsolescent gcc or gdb)"
596 test_one_ptype "ptype pVB" "ptype pVB" \
597 "((struct|class) VB \{${ws}public:|struct VB \{)" \
600 "" "int fvb\\((void|)\\);${ws}virtual int vvb\\((void|)\\);" \
601 "VB & operator=\\(VB const ?&\\);${ws}VB\\(VB const ?&\\);${ws}VB\\((void|)\\);" \
602 "VB & operator=\\(VB const ?&\\);${ws}VB\\(VB const ?&\\);${ws}VB\\((void|)\\);" \
606 # Call virtual functions.
608 proc test_virtual_calls {} {
612 if [target_info exists gdb,cannot_call_functions] {
613 setup_xfail "*-*-*" 2416
614 fail "This target can not call functions"
618 gdb_test "print pAe->f()" "\\$\[0-9\]+ = 20"
619 gdb_test "print pAa->f()" "\\$\[0-9\]+ = 1"
620 gdb_test "print pDe->vg()" "\\$\[0-9\]+ = 202"
621 gdb_test "print pADe->vg()" "\\$\[0-9\]+ = 202"
622 gdb_test "print pDd->vg()" "\\$\[0-9\]+ = 101"
623 gdb_test "print pEe->vvb()" "\\$\[0-9\]+ = 411"
624 gdb_test "print pVB->vvb()" "\\$\[0-9\]+ = 407"
625 gdb_test "print pBe->vvb()" "\\$\[0-9\]+ = 411"
626 gdb_test "print pDe->vvb()" "\\$\[0-9\]+ = 411"
627 gdb_test "print pEe->vd()" "\\$\[0-9\]+ = 282"
628 gdb_test "print pEe->fvb()" "\\$\[0-9\]+ = 311"
630 # fails on target=native, host=i686-pc-linux-gnu%rh-7.2,
631 # gdb=HEAD%2002-02-16, gcc=2.95.3, goption=-gdwarf-2.
633 # fails on target=native, host=i686-pc-linux-gnu%rh-7.2,
634 # gdb=HEAD%2002-02-16, gcc=2.95.3, goption=-gstabs+.
636 # fails on target=native, host=i686-pc-linux-gnu%rh-7.2,
637 # gdb=HEAD%2002-02-16, gcc=3.0.3, goption=-gdwarf-2.
639 # fails on target=native, host=i686-pc-linux-gnu%rh-7.2,
640 # gdb=HEAD%2002-02-16, gcc=3.0.3, goption=-gstabs+.
642 # fails on target=native, host=i686-pc-linux-gnu%rh-7.2,
643 # gdb=HEAD%2002-02-16, gcc=3.0.4-20020215, goption=-gdwarf-2.
645 # fails on target=native, host=i686-pc-linux-gnu%rh-7.2,
646 # gdb=HEAD%2002-02-16, gcc=3.0.4-20020215, goption=-gstabs+.
648 # fails on target=native, host=i686-pc-linux-gnu%rh-7.2,
649 # gdb=HEAD%2002-02-16, gcc=gcc-3_0-branch%2002-02-16, goption=-gdwarf-2.
651 # fails on target=native, host=i686-pc-linux-gnu%rh-7.2,
652 # gdb=HEAD%2002-02-16, gcc=gcc-3_0-branch%2002-02-16, goption=-gstabs+.
654 # fails on target=native, host=i686-pc-linux-gnu%rh-7.2,
655 # gdb=HEAD%2002-02-16, gcc=HEAD%2002-02-16, goption=-gdwarf-2.
657 # fails on target=native, host=i686-pc-linux-gnu%rh-7.2,
658 # gdb=HEAD%2002-02-16, gcc=HEAD%2002-02-16, goption=-gstabs+.
660 # -- chastain 2002-02-20
662 # more recent results:
664 # gcc 2.95.3 -gdwarf-2
665 # gcc 2.95.3 -gstabs+
666 # attempt to take addres of value not located in memory
667 # gcc 3.3.2 -gdwarf-2
670 # -- chastain 2003-12-31
672 gdb_test_multiple "print pEe->D::vg()" "print pEe->D::vg()" {
673 -re "\\$\[0-9]+ = 102$nl$gdb_prompt $" {
674 pass "print pEe->D::vg()"
676 -re "Attempt to take address of value not located in memory.$nl$gdb_prompt $" {
677 kfail "gdb/1064" "print pEe->D::vg()"
685 global srcdir subdir binfile
693 gdb_reinitialize_dir $srcdir/$subdir
696 gdb_test "set language c++" "" ""
697 gdb_test "set width 0" "" ""
700 test_ptype_of_classes
702 gdb_breakpoint test_calls
703 gdb_test "continue" ".*Breakpoint .* test_calls.*" ""