c++/24367: Infinite recursion of typedef substitution
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.cp / rtti.exp
index d9e413f4aaefaf0d849d6f5321f444e37b563d5a..34b23605ec13b72ce0e564adfcdf62e63999d6ad 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 2003-2004, 2007-2012 Free Software Foundation, Inc.
+# Copyright 2003-2019 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
@@ -32,38 +32,17 @@ if { [skip_cplus_tests] } { continue }
 # test running programs
 #
 
-set testfile "rtti"
-set srcfile1 "${testfile}1.cc"
-set objfile1 "${testfile}1.o"
-set srcfile2 "${testfile}2.cc"
-set objfile2 "${testfile}2.o"
-set binfile  "${objdir}/${subdir}/${testfile}"
+standard_testfile rtti1.cc rtti2.cc
 
-if  { [gdb_compile "$srcdir/$subdir/$srcfile1" "$objdir/$subdir/$objfile1" object {debug c++}] != "" } {
-     untested rtti.exp
-     return -1
-}
-
-if  { [gdb_compile "$srcdir/$subdir/$srcfile2" "$objdir/$subdir/$objfile2" object {debug c++}] != "" } {
-     untested rtti.exp
-     return -1
-}
-
-if  { [gdb_compile "$objdir/$subdir/$objfile1 $objdir/$subdir/$objfile2" "${binfile}" executable {debug c++}] != "" } {
-     untested rtti.exp
-     return -1
+if [get_compiler_info "c++"] {
+    return -1
 }
 
-if [get_compiler_info ${binfile} "c++"] {
+if {[prepare_for_testing "failed to prepare" $testfile \
+        [list $srcfile $srcfile2] {debug c++}]} {
     return -1
 }
 
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
-
-
 if ![runto_main] then {
     perror "couldn't run to breakpoint"
     continue
@@ -71,7 +50,7 @@ if ![runto_main] then {
 
 # First, run to after we've constructed the object:
 
-gdb_breakpoint [gdb_get_line_number "main-constructs-done" "$srcfile1"]
+gdb_breakpoint [gdb_get_line_number "main-constructs-done" "$srcfile"]
 gdb_continue_to_breakpoint "end of constructors in main"
 
 gdb_test_multiple "print *e1" "print *e1" {
@@ -127,12 +106,12 @@ gdb_test_multiple "print *e2" "print *e2" {
 # Now we test the hack that's been implemented to get around some
 # instances of PR gdb/1511.
 
-gdb_breakpoint [gdb_get_line_number "func-constructs-done" "$srcfile1"]
+gdb_breakpoint [gdb_get_line_number "func-constructs-done" "$srcfile"]
 gdb_continue_to_breakpoint "end of constructors in func"
 
 gdb_test "print *obj" "\\$\[0-9\]* = {<n2::Base2> = .*}"
 
-gdb_breakpoint [gdb_get_line_number "func3-constructs-done" "$srcfile1"]
+gdb_breakpoint [gdb_get_line_number "func3-constructs-done" "$srcfile"]
 gdb_continue_to_breakpoint "end of constructors in func3"
 
 gdb_test "print *obj3" "\\$\[0-9\]* = {<n2::C2> = .*}"
This page took 0.024798 seconds and 4 git commands to generate.