gdb/testsuite: add simavr.exp board
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.cp / cplusfuncs.exp
index 0a16a8a06b8c30a5e8c228bddebf6db128939688..34b46ed52507b17e746c00729c02c4d6968f0c0f 100644 (file)
@@ -1,5 +1,4 @@
-# Copyright 1992, 1997, 1999, 2001-2004, 2007-2012 Free Software
-# Foundation, Inc.
+# Copyright 1992-2020 Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
 
 if { [skip_cplus_tests] } { continue }
 
-set testfile "cplusfuncs"
-set srcfile ${testfile}.cc
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile .cc
 
 if { [get_compiler_info "c++"] } {
     return -1
 }
 
-if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
-     untested cplusfuncs.exp
-     return -1
+if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} {
+    return -1
 }
 
 #
@@ -296,7 +292,7 @@ proc info_func_regexp { name demangled } {
     regsub {\\\(void\\\)} $demangled {\(\)} demangled
 
     gdb_test "info function $name" \
-       "File .*:\r\n(class|)${demangled}.*" \
+       "File .*:\t(class|)${demangled}.*" \
        "info function for \"$name\""
 }
 
@@ -447,7 +443,6 @@ proc test_lookup_operator_functions {} {
 
 proc test_paddr_operator_functions {} {
     global hex
-    global hp_aCC_compiler
     global dm_operator_comma
     global dm_type_char_star
     global dm_type_foo_ref
@@ -500,13 +495,9 @@ proc test_paddr_operator_functions {} {
        " = .* $hex <foo::operator new\\(.*\\)(| static)>"
     gdb_test "print &foo::operator new\[\]" \
        " = .* $hex <foo::operator new\\\[\\\]\\(.*\\)(| static)>"    
-    if { !$hp_aCC_compiler } {
-       print_addr "foo::operator delete($dm_type_void_star)"
-       print_addr "foo::operator delete[]($dm_type_void_star)"
-    } else {
-       gdb_test "print &'foo::operator delete($dm_type_void_star) static'" \
-           " = .*(0x\[0-9a-f\]+|) <foo::operator delete.*>"
-    }
+
+    print_addr "foo::operator delete($dm_type_void_star)"
+    print_addr "foo::operator delete[]($dm_type_void_star)"
 
     print_addr "foo::operator int($dm_type_void)"
     print_addr "foo::operator $dm_operator_char_star\($dm_type_void)"
@@ -584,20 +575,10 @@ proc test_paddr_hairy_functions {} {
 }
 
 proc do_tests {} {
-    global subdir
-    global objdir
-    global srcdir
     global binfile
-    global gdb_prompt
     global dm_type_int_star
 
-
-    # Start with a fresh gdb.
-
-    gdb_exit
-    gdb_start
-    gdb_reinitialize_dir $srcdir/$subdir
-    gdb_load $binfile
+    clean_restart $binfile
 
     gdb_test_no_output "set width 0"
 
This page took 0.02811 seconds and 4 git commands to generate.