1 # Copyright 1998-2014 Free Software Foundation, Inc.
3 # This file is part of the gdb testsuite
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3 of the License, or
8 # (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program. If not, see <http://www.gnu.org/licenses/>.
18 # Tests for pointer-to-member support
19 # Written by Satish Pai <pai@apollo.hp.com> 1997-08-19
20 # Rewritten by Michael Chastain <mec.gnu@mindspring.com> 2004-01-11
24 if { [skip_cplus_tests] } { continue }
29 if [get_compiler_info "c++"] {
33 if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug c++}]} {
37 if ![runto_main] then {
38 perror "couldn't run to breakpoint"
42 gdb_breakpoint [gdb_get_line_number "Breakpoint 1 here"]
43 gdb_continue_to_breakpoint "continue to pmi = NULL"
45 # ======================
46 # pointer to member data
47 # ======================
49 # ptype on pointer to data member
51 set name "ptype pmi (A::j)"
52 gdb_test_multiple "ptype pmi" $name {
53 -re "type = int A::\\*\r\n$gdb_prompt $" {
58 # print pointer to data member
60 set name "print pmi (A::j) "
61 gdb_test_multiple "print pmi" $name {
62 -re "$vhn = &A::j\r\n$gdb_prompt $" {
65 -re "$vhn = \\(int ?\\( ?A::\\*\\)\\) &A::j\r\n$gdb_prompt $" {
68 -re "$vhn = \\(int ?\\( ?A::\\*\\)\\) ?&A::j ?\\+ ?1 bytes\r\n$gdb_prompt $" {
69 # gcc 2.95.3 -gdwarf-2
70 kfail "gdb/NNNN" $name
72 -re "$vhn = &A::j ?\\+ ?1 bytes\r\n$gdb_prompt $" {
74 kfail "gdb/NNNN" $name
76 -re "$vhn = not implemented: member type in c_val_print\r\n$gdb_prompt $" {
77 # gcc HEAD 2004-01-11 05:33:21 -gdwarf-2
78 # gcc HEAD 2004-01-11 05:33:21 -gstabs+
79 kfail "gdb/NNNN" $name
81 -re "$vhn = \\(int ?\\( A::\\*\\)\\) 536870920\r\n$gdb_prompt $" {
82 # the value is 0x20000008 hex. 0x20000000 is an internal flag.
83 # Use '|' to add in more values as needed.
85 kfail "gdb/NNNN" $name
89 # print dereferenced pointer to data member
91 set name "print a.*pmi (A::j)"
92 gdb_test_multiple "print a.*pmi" $name {
93 -re "$vhn = 121\r\n$gdb_prompt $" {
96 -re "$vhn = 855638016\r\n$gdb_prompt $" {
97 # gcc 2.95.3 -gdwarf-2
99 kfail "gdb/NNNN" $name
101 -re "not implemented: member types in unpack_long\r\n$gdb_prompt $" {
102 # gcc HEAD 2004-01-10 -gdwarf-2
103 # gcc HEAD 2004-01-10 -gstabs+
104 kfail "gdb/NNNN" $name
108 # print dereferenced pointer to data member
109 # this time, dereferenced through a pointer
111 set name "print a_p->*pmi (A::j)"
112 gdb_test_multiple "print a_p->*pmi" $name {
113 -re "$vhn = 121\r\n$gdb_prompt $" {
116 -re "$vhn = 855638016\r\n$gdb_prompt $" {
117 # gcc 2.95.3 -gdwarf-2
118 # gcc 2.95.3 -gstabs+
119 kfail "gdb/NNNN" $name
121 -re "not implemented: member types in unpack_long\r\n$gdb_prompt $" {
122 # gcc HEAD 2004-01-10 -gdwarf-2
123 # gcc HEAD 2004-01-10 -gstabs+
124 kfail "gdb/NNNN" $name
128 # set the pointer to a different data member
130 set name "set var pmi = &A::jj"
131 gdb_test_multiple "set var pmi = &A::jj" $name {
132 -re "Invalid cast.\r\n$gdb_prompt $" {
133 # gcc HEAD 2004-01-10 -gdwarf-2
134 # gcc HEAD 2004-01-10 -gstabs+
135 kfail "gdb/NNNN" $name
137 -re "set var pmi = &A::jj\r\n$gdb_prompt $" {
138 # I have to match the echo'ed input explicitly here.
139 # If I leave it out, the pattern becomes too general
140 # and matches anything that ends in "$gdb_prompt $".
145 # print the pointer again
147 set name "print pmi (A::jj)"
148 gdb_test_multiple "print pmi" $name {
149 -re "$vhn = &A::jj\r\n$gdb_prompt $" {
152 -re "$vhn = \\(int ?\\( ?A::\\*\\)\\) &A::jj\r\n$gdb_prompt $" {
155 -re "$vhn = not implemented: member type in c_val_print\r\n$gdb_prompt $" {
156 # gcc HEAD 2004-01-11 05:33:21 -gdwarf-2
157 # gcc HEAD 2004-01-11 05:33:21 -gstabs+
158 kfail "gdb/NNNN" $name
160 -re "$vhn = \\(int ?\\( A::\\*\\)\\) 536870924\r\n$gdb_prompt $" {
161 # the value is 0x20000008 hex. 0x20000000 is an internal flag.
162 # Use '|' to add in more values as needed.
164 kfail "gdb/NNNN" $name
168 # print dereferenced pointer to data member again
170 set name "print a.*pmi (A::jj)"
171 gdb_test_multiple "print a.*pmi" $name {
172 -re "$vhn = 1331\r\n$gdb_prompt $" {
175 -re "not implemented: member types in unpack_long\r\n$gdb_prompt $" {
176 # gcc HEAD 2004-01-10 -gdwarf-2
177 # gcc HEAD 2004-01-10 -gstabs+
178 kfail "gdb/NNNN" $name
182 # set the pointer to data member back to A::j
184 set name "set var pmi = &A::j"
185 gdb_test_multiple "set var pmi = &A::j" $name {
186 -re "Invalid cast.\r\n$gdb_prompt $" {
187 # gcc HEAD 2004-01-10 -gdwarf-2
188 # gcc HEAD 2004-01-10 -gstabs+
189 kfail "gdb/NNNN" $name
191 -re "set var pmi = &A::j\r\n$gdb_prompt $" {
192 # I have to match the echo'ed input explicitly here.
193 # If I leave it out, the pattern becomes too general
194 # and matches anything that ends in "$gdb_prompt $".
199 # print dereferenced pointer to data member yet again (extra check, why not)
201 set name "print a.*pmi (A::j) (again)"
202 gdb_test_multiple "print a.*pmi" $name {
203 -re "$vhn = 121\r\n$gdb_prompt $" {
206 -re "not implemented: member types in unpack_long\r\n$gdb_prompt $" {
207 # gcc HEAD 2004-01-10 -gdwarf-2
208 # gcc HEAD 2004-01-10 -gstabs+
209 kfail "gdb/NNNN" $name
213 # Set the data member pointed to.
215 set name "print a.*pmi = 33"
216 gdb_test_multiple "print a.*pmi = 33" $name {
217 -re "$vhn = 33\r\n$gdb_prompt $" {
220 -re "not implemented: member types in unpack_long\r\n$gdb_prompt $" {
221 # gcc HEAD 2004-01-10 -gdwarf-2
222 # gcc HEAD 2004-01-10 -gstabs+
223 kfail "gdb/NNNN" $name
227 # Now check that the data really was changed
229 set name "print a.*pmi (A::j) (33)"
230 gdb_test_multiple "print a.*pmi" $name {
231 -re "$vhn = 33\r\n$gdb_prompt $" {
234 -re "not implemented: member types in unpack_long\r\n$gdb_prompt $" {
235 # gcc HEAD 2004-01-10 -gdwarf-2
236 # gcc HEAD 2004-01-10 -gstabs+
237 kfail "gdb/NNNN" $name
241 # Double-check by printing a.
243 set name "print a (j = 33)"
244 gdb_test_multiple "print a" $name {
245 -re "$vhn = \{c = 120 'x', j = 33, jj = 1331, (static|static int) s = 10, (_vptr.A|_vptr\\$) = ($hex|$hex <A virtual table>)\}\r\n$gdb_prompt $" {
248 -re "$vhn = \{c = 120 'x', j = 33, jj = 1331, (static|static int) s = 10, Virtual table at $hex\}\r\n$gdb_prompt $" {
251 -re "$vhn = \{(_vptr.A|_vptr\\$) = ${hex}( <vtable for A.*>)?, c = 120 'x', j = 33, jj = 1331, (static|static int) s = 10\}\r\n$gdb_prompt $" {
254 -re "$vhn = \{(_vptr.A|_vptr\\$) = $hex, c = 120 'x', j = 121, jj = 1331, (static|static int) s = 10\}\r\n$gdb_prompt $" {
255 # gcc HEAD 2004-01-10 -gdwarf-2
256 # gcc HEAD 2004-01-10 -gstabs+
257 kfail "gdb/NNNN" $name
261 # Set the data member pointed to, using ->*
263 set name "print a_p->*pmi = 44"
264 gdb_test_multiple "print a_p->*pmi = 44" $name {
265 -re "$vhn = 44\r\n$gdb_prompt $" {
268 -re "not implemented: member types in unpack_long\r\n$gdb_prompt $" {
269 # gcc HEAD 2004-01-10 -gdwarf-2
270 # gcc HEAD 2004-01-10 -gstabs+
271 kfail "gdb/NNNN" $name
275 # Check that the data really was changed
277 set name "print a_p->*pmi (44)"
278 gdb_test_multiple "print a_p->*pmi" $name {
279 -re "$vhn = 44\r\n$gdb_prompt $" {
282 -re "not implemented: member types in unpack_long\r\n$gdb_prompt $" {
283 # gcc HEAD 2004-01-10 -gdwarf-2
284 # gcc HEAD 2004-01-10 -gstabs+
285 kfail "gdb/NNNN" $name
289 # Double-check by printing a.
291 set name "print a (j = 44)"
292 gdb_test_multiple "print a" $name {
293 -re "$vhn = \{c = 120 'x', j = 44, jj = 1331, (static|static int) s = 10, (_vptr.A|_vptr\\$) = ($hex|$hex <A virtual table>)\}\r\n$gdb_prompt $" {
296 -re "$vhn = \{c = 120 'x', j = 44, jj = 1331, (static|static int) s = 10, Virtual table at $hex\}\r\n$gdb_prompt $" {
299 -re "$vhn = \{(_vptr.A|_vptr\\$) = ${hex}( <vtable for A.*>), c = 120 'x', j = 44, jj = 1331, (static|static int) s = 10\}\r\n$gdb_prompt $" {
302 -re "$vhn = \{(_vptr.A|_vptr\\$) = $hex, c = 120 'x', j = 121, jj = 1331, (static|static int) s = 10\}\r\n$gdb_prompt $" {
303 # gcc HEAD 2004-01-10 -gdwarf-2
304 # gcc HEAD 2004-01-10 -gstabs+
305 kfail "gdb/NNNN" $name
309 # ptype the dereferenced pointer to member.
311 set name "ptype a.*pmi"
312 gdb_test_multiple "ptype a.*pmi" $name {
313 -re "type = int\r\n$gdb_prompt" {
316 -re "not implemented: member types in unpack_long\r\n$gdb_prompt $" {
317 # gcc HEAD 2004-01-10 -gdwarf-2
318 # gcc HEAD 2004-01-10 -gstabs+
319 kfail "gdb/NNNN" $name
323 # dereference the pointer to data member without any object
324 # this is not allowed: a pmi must be bound to an object to dereference
326 set name "print *pmi"
327 gdb_test_multiple "print *pmi" $name {
328 -re "Attempt to dereference pointer to member without an object\r\n$gdb_prompt $" {
331 -re "Cannot access memory at address 0x4\r\n$gdb_prompt $" {
332 # gcc 2.95.3 -gstabs+
333 kfail "gdb/NNNN" $name
335 -re "Cannot access memory at address 0x8\r\n$gdb_prompt $" {
336 # gcc 3.3.2 -gdwarf-2
338 kfail "gdb/NNNN" $name
342 # dereference the pointer to data member without any object
343 # this is not allowed: a pmi must be bound to an object to dereference
345 set name "ptype *pmi"
346 gdb_test_multiple "ptype *pmi" $name {
347 -re "Attempt to dereference pointer to member without an object\r\n$gdb_prompt $" {
350 -re "type = int A::\r\n$gdb_prompt $" {
351 # gcc 2.95.3 -gstabs+
352 # gcc HEAD 2004-01-10 -gdwarf-2
353 # gcc HEAD 2004-01-10 -gstabs+
354 kfail "gdb/NNNN" $name
358 # Check cast of pointer to member to integer.
359 # This is similar to "offset-of".
360 # such as "A a; print (size_t) &A.j - (size_t) &A".
362 set name "print (int) pmi"
363 gdb_test_multiple "print (int) pmi" $name {
364 -re "$vhn = (4|8|12)\r\n$gdb_prompt" {
369 # Check "(int) pmi" explicitly for equality.
371 set name "print ((int) pmi) == ((char *) &a.j - (char *) &a)"
372 gdb_test_multiple "print ((int) pmi) == ((char *) &a.j - (char *) & a)" $name {
373 -re "$vhn = true\r\n$gdb_prompt" {
378 # Check pointers to data members, which are themselves pointers to
379 # functions. These behave like data members, not like pointers to
382 gdb_test "ptype diamond_pfunc_ptr" \
383 "type = int \\(\\*Diamond::\\*\\)\\(int\\)"
385 gdb_test "ptype diamond.*diamond_pfunc_ptr" \
386 "type = int \\(\\*\\)\\(int\\)"
388 # This one is invalid; () binds more tightly than .*, so it tries to
389 # call the member pointer as a normal pointer-to-function.
391 gdb_test "print diamond.*diamond_pfunc_ptr (20)" \
392 "Invalid data type for function to be called."
394 # With parentheses, it is valid.
396 gdb_test "print (diamond.*diamond_pfunc_ptr) (20)" \
399 # Make sure that we do not interpret this as either a member pointer
400 # call or a member function call.
402 gdb_test "print diamond.func_ptr (20)" \
405 # ==========================
406 # pointer to member function
407 # ==========================
409 # ptype a pointer to a method
412 gdb_test_multiple "ptype pmf" $name {
413 -re "type = int \\( ?A::\\*\\)\\(A \\*( const)?, int\\)\r\n$gdb_prompt $" {
416 -re "type = int \\( ?A::\\*\\)\\(void\\)\r\n$gdb_prompt $" {
418 kfail "gdb/NNNN" $name
420 -re "type = struct \{.*\}\r\n$gdb_prompt $" {
421 # gcc 2.95.3 -gdwarf-2
422 # gcc 2.95.3 -gstabs+
423 # gcc 3.2.2 -gdwarf-2
425 # gcc HEAD 2004-01-10 -gdwarf-2
426 # gcc HEAD 2004-01-10 -gstabs+
427 kfail "gdb/NNNN" $name
431 # print a pointer to a method
434 gdb_test_multiple "print pmf" $name {
435 -re "$vhn = \\(int \\(A::\\*\\)\\(A \\*( const)?, int\\)\\) $hex <A::bar\\(int\\)>\r\n$gdb_prompt $" {
438 -re "$vhn = .*not supported with HP aCC.*\r\n$gdb_prompt $" {
440 kfail "gdb/NNNN" $name
442 -re "$vhn = \{.*\}\r\n$gdb_prompt $" {
443 # gcc 2.95.3 -gdwarf-2
444 # gcc 2.95.3 -gstabs+
445 # gcc 3.2.2 -gdwarf-2
447 # gcc HEAD 2004-01-10 -gdwarf-2
448 # gcc HEAD 2004-01-10 -gstabs+
449 kfail "gdb/NNNN" $name
453 # ptype a pointer to a pointer to a method
455 set name "ptype pmf_p"
456 gdb_test_multiple "ptype pmf_p" $name {
457 -re "type = int \\( ?A::\\*\\*\\)\\(A \\*( const)?, int\\)\r\n$gdb_prompt $" {
460 -re "type = int \\( ?A::\\*\\*\\)\\(void\\)\r\n$gdb_prompt $" {
462 kfail "gdb/NNNN" $name
464 -re "type = struct \{.*\} \\*\r\n$gdb_prompt $" {
465 # gcc 2.95.3 -gdwarf-2
466 # gcc 2.95.3 -gstabs+
467 # gcc 3.2.2 -gdwarf-2
469 # gcc HEAD 2004-01-10 -gdwarf-2
470 # gcc HEAD 2004-01-10 -gstabs+
471 kfail "gdb/NNNN" $name
475 # print a pointer to a pointer to a method
477 set name "print pmf_p"
478 gdb_test_multiple "print pmf_p" $name {
479 -re "$vhn = \\(int \\( ?A::\\*\\*\\)\\)\\(int\\)\\) $hex\r\n$gdb_prompt $" {
482 -re "$vhn = \\(PMF \\*\\) $hex\r\n$gdb_prompt $" {
485 -re "$vhn = \\(int \\( ?A::\\*\\*\\)\\(void\\)\\) $hex\r\n$gdb_prompt $" {
487 kfail "gdb/NNNN" $name
489 -re "$vhn = \\(struct \{.*\} \\*\\) $hex\r\n$gdb_prompt $" {
490 # gcc 2.95.3 -gdwarf-2
491 kfail "gdb/NNNN" $name
495 # print dereferenced pointer to method
497 set name "print a.*pmf"
498 gdb_test_multiple "print a.*pmf" $name {
499 -re "$vhn = {int \\(A \\*( const)?, int\\)} $hex <A::bar\\(int\\)>\r\n$gdb_prompt $" {
502 -re "Pointers to methods not supported with HP aCC\r\n$gdb_prompt $" {
504 kfail "gdb/NNNN" $name
506 -re "Value can't be converted to integer.\r\n$gdb_prompt $" {
507 # gcc 2.95.3 -gdwarf-2
508 # gcc 2.95.3 -gstabs+
509 # gcc 3.2.2 -gdwarf-2
511 # gcc HEAD 2004-01-10 -gdwarf-2
512 # gcc HEAD 2004-01-10 -gstabs+
513 kfail "gdb/NNNN" $name
517 # print dereferenced pointer to method, using ->*
519 set name "print a_p->*pmf"
520 gdb_test_multiple "print a_p->*pmf" $name {
521 -re "$vhn = {int \\(A \\*( const)?, int\\)} $hex <A::bar\\(int\\)>\r\n$gdb_prompt $" {
524 -re "Pointers to methods not supported with HP aCC\r\n$gdb_prompt $" {
526 kfail "gdb/NNNN" $name
528 -re "Value can't be converted to integer.\r\n$gdb_prompt $" {
529 # gcc 2.95.3 -gdwarf-2
530 # gcc 2.95.3 -gstabs+
531 # gcc 3.2.2 -gdwarf-2
533 # gcc HEAD 2004-01-10 -gdwarf-2
534 # gcc HEAD 2004-01-10 -gstabs+
535 kfail "gdb/NNNN" $name
539 # set the pointer to data member
541 set name "set var pmf = &A::foo"
542 gdb_test_multiple "set var pmf = &A::foo" $name {
543 -re "set var pmf = &A::foo\r\n$gdb_prompt $" {
544 # I have to match the echo'ed input explicitly here.
545 # If I leave it out, the pattern becomes too general
546 # and matches anything that ends in "$gdb_prompt $".
549 -re "Invalid cast.\r\n$gdb_prompt $" {
550 # gcc 2.95.3 -gdwarf-2
551 # gcc 2.95.3 -gstabs+
552 # gcc 3.2.2 -gdwarf-2
554 # gcc HEAD 2004-01-10 -gdwarf-2
555 # gcc HEAD 2004-01-10 -gstabs+
556 kfail "gdb/NNNN" $name
558 -re "Assignment to pointers to methods not implemented with HP aCC\r\n$gdb_prompt $" {
559 kfail "gdb/NNNN" $name
563 # dereference the pointer to data member without any object
564 # this is not allowed: a pmf must be bound to an object to dereference
566 set name "print *pmf"
567 gdb_test_multiple "print *pmf" $name {
568 -re "Attempt to dereference pointer to member without an object\r\n$gdb_prompt $" {
571 -re "Structure has no component named operator\\*.\r\n$gdb_prompt $" {
572 # gcc 2.95.3 -gdwarf-2
573 # gcc 2.95.3 -gstabs+
574 # gcc 3.3.2 -gdwarf-2
576 # gcc HEAD 2004-01-10 -gdwarf-2
577 # gcc HEAD 2004-01-10 -gstabs+
578 kfail "gdb/NNNN" $name
582 # dereference the pointer to data member without any object
583 # this is not allowed: a pmf must be bound to an object to dereference
585 set name "ptype *pmf"
586 gdb_test_multiple "ptype *pmf" $name {
587 -re "Attempt to dereference pointer to member without an object\r\n$gdb_prompt $" {
590 -re "Structure has no component named operator\\*.\r\n$gdb_prompt $" {
591 # gcc 2.95.3 -gdwarf-2
592 # gcc 2.95.3 -gstabs+
593 # gcc 3.3.2 -gdwarf-2
595 # gcc HEAD 2004-01-10 -gdwarf-2
596 # gcc HEAD 2004-01-10 -gstabs+
597 kfail "gdb/NNNN" $name
601 # Call a function through a pmf.
603 set name "print (a.*pmf)(3)"
604 gdb_test_multiple "print (a.*pmf)(3)" $name {
605 -re "$vhn = 50\r\n$gdb_prompt $" {
608 -re "Not implemented: function invocation through pointer to method with HP aCC\r\n$gdb_prompt $" {
610 kfail "gdb/NNNN" $name
612 -re "Value can't be converted to integer.\r\n$gdb_prompt $" {
613 # gcc 2.95.3 -gdwarf-2
614 # gcc 2.95.3 -gstabs+
615 # gcc 3.3.2 -gdwarf-2
617 # gcc HEAD 2004-01-10 -gdwarf-2
618 # gcc HEAD 2004-01-10 -gstabs+
619 kfail "gdb/NNNN" $name
623 gdb_test "ptype a.*pmf" "type = int \\(A \\*( const)?, int\\)"
624 gdb_test "ptype (a.*pmf)(3)" "type = int"
626 # Print out a pointer to data member which requires looking into
628 gdb_test "print diamond_pmi" "$vhn = &Base::x"
629 gdb_test "print diamond.*diamond_pmi" "$vhn = 77"
631 # Examine some more complicated pmfs, which require adjusting "this"
632 # and looking through virtual tables.
634 # These two have a different object adjustment, but call the same method.
635 gdb_test "print diamond.*left_pmf" \
636 "$vhn = {int \\(Diamond \\*( const)?\\)} $hex <Base::get_x\\((void|)\\)>"
637 gdb_test "print diamond.*right_pmf" \
638 "$vhn = {int \\(Diamond \\*( const)?\\)} $hex <Base::get_x\\((void|)\\)>"
640 gdb_test "print (diamond.*left_pmf) ()" "$vhn = 77"
641 gdb_test "print (diamond.*right_pmf) ()" "$vhn = 88"
643 # These two point to different methods, although they have the same
644 # virtual table offsets.
645 gdb_test "print diamond.*left_vpmf" \
646 "$vhn = {int \\(Diamond \\*( const)?\\)} $hex <Left::vget\\((void|)\\)>"
647 gdb_test "print diamond.*right_vpmf" \
648 "$vhn = {int \\(Diamond \\*( const)?\\)} $hex <Right::vget\\((void|)\\)>"
650 gdb_test "print (diamond.*left_vpmf) ()" "$vhn = 177"
651 gdb_test "print (diamond.*left_base_vpmf) ()" "$vhn = 2077"
652 gdb_test "print (diamond.*right_vpmf) ()" "$vhn = 288"
654 # We should be able to figure out left_vpmf even without an object,
655 # because it comes from a non-virtual base. The same for right_vpmf.
656 gdb_test "print left_vpmf" "$vhn = &virtual Left::vget\\(\\)"
657 gdb_test "print right_vpmf" "$vhn = &virtual Right::vget\\(\\)"
659 # But we should gracefully fail to figure out base_vpmf, because
660 # its runtime type is more derived than its static type. This
661 # is a valid but unspecified cast (it is value preserving, i.e.
662 # can be casted back to the correct type and used).
663 gdb_test "print base_vpmf" \
664 "$vhn = &virtual table offset \[0-9\]*, this adjustment -\[0-9\]*"
666 # Make sure we parse this correctly; it's invalid.
667 gdb_test "print diamond.*left_vpmf ()" \
668 "Invalid data type for function to be called\\."
670 # NULL pointer to member tests.
671 gdb_test "print null_pmi" "$vhn = NULL"
672 gdb_test "print null_pmi = &A::j" "$vhn = &A::j"
673 gdb_test "print null_pmi = 0" "$vhn = NULL"
675 gdb_test "print null_pmf" "$vhn = NULL"
676 gdb_test "print null_pmf = &A::foo" "$vhn = \\(int \\(A::\\*\\)\\(A \\*( const)?, int\\)\\) $hex <A::foo ?\\(int\\)>"
677 gdb_test "print null_pmf = 0" "$vhn = NULL"