* gdb.opt/clobbered-registers-O2.exp: Use standard_testfile,
authorTom Tromey <tromey@redhat.com>
Mon, 25 Jun 2012 20:24:57 +0000 (20:24 +0000)
committerTom Tromey <tromey@redhat.com>
Mon, 25 Jun 2012 20:24:57 +0000 (20:24 +0000)
prepare_for_testing.
* gdb.opt/inline-break.exp: Use standard_testfile,
prepare_for_testing.
* gdb.opt/inline-bt.exp: Use standard_testfile,
prepare_for_testing.
* gdb.opt/inline-cmds.exp: Use standard_testfile,
prepare_for_testing.
* gdb.opt/inline-locals.exp: Use standard_testfile,
prepare_for_testing.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.opt/clobbered-registers-O2.exp
gdb/testsuite/gdb.opt/inline-break.exp
gdb/testsuite/gdb.opt/inline-bt.exp
gdb/testsuite/gdb.opt/inline-cmds.exp
gdb/testsuite/gdb.opt/inline-locals.exp

index 8fc997138b4659be7ff6dc3d4a407d6d0a8c10c8..0f59fac5427febc00688b157cb84650809521ef9 100644 (file)
@@ -1,3 +1,16 @@
+2012-06-25  Tom Tromey  <tromey@redhat.com>
+
+       * gdb.opt/clobbered-registers-O2.exp: Use standard_testfile,
+       prepare_for_testing.
+       * gdb.opt/inline-break.exp: Use standard_testfile,
+       prepare_for_testing.
+       * gdb.opt/inline-bt.exp: Use standard_testfile,
+       prepare_for_testing.
+       * gdb.opt/inline-cmds.exp: Use standard_testfile,
+       prepare_for_testing.
+       * gdb.opt/inline-locals.exp: Use standard_testfile,
+       prepare_for_testing.
+
 2012-06-25  Tom Tromey  <tromey@redhat.com>
 
        * gdb.asm/asm-source.exp: Use standard_output_file,
index 0c319800518b4c15859cffbba71da036076aa3eb..a733baa0d187bd5d2227be0f57c13f53e4f0b201 100644 (file)
@@ -18,9 +18,7 @@
 # Test displaying call clobbered registers in optimized binaries.
 # GDB should not show incorrect values.
 
-set testfile clobbered-registers-O2
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile
 
 # What compiler are we using?
 #
@@ -28,19 +26,11 @@ if [get_compiler_info] {
     return -1
 }
 
-if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [concat debug optimize=-O2 nowarnings]] != "" } {
-     untested clobbered-registers-O2.exp
-     return -1
+if {[prepare_for_testing $testfile.exp $testfile $srcfile \
+        {debug optimize=-O2 nowarnings}]} {
+    return -1
 }
 
-# use this to debug:
-#log_user 1
-
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
-
 if { ![runto start_sequence] } then {
    fail "run to start_sequence"
    return
index c357723508564437203e9f2732a0a5ba2a6d9f7c..2a7ef39d67b27e1cea822c5cb68e3d6cdaed39f5 100644 (file)
 # mirrors this testcase, and should be updated if this testcase is
 # changed.
 
-set basename "inline-break"
-set testfile $basename
+standard_testfile
 
-if { [prepare_for_testing $testfile.exp $testfile $testfile.c \
+if { [prepare_for_testing $testfile.exp $testfile $srcfile \
           {debug optimize=-O2 additional_flags=-Winline}] } {
     return -1
 }
@@ -30,7 +29,7 @@ if { [prepare_for_testing $testfile.exp $testfile $testfile.c \
 # The result should be a single-location breakpoint.
 #
 gdb_test "break func1" \
-    "Breakpoint.*at.* file .*$basename\\.c, line.*"
+    "Breakpoint.*at.* file .*$srcfile, line.*"
 
 #
 # func2 is a non-static inlined function that is called once.
@@ -46,7 +45,7 @@ gdb_test "break func2" \
 # a single-location breakpoint.
 #
 gdb_test "break func3b" \
-    "Breakpoint.*at.* file .*$basename\\.c, line.*"
+    "Breakpoint.*at.* file .*$srcfile, line.*"
 
 #
 # func4b is a static inlined function that is called once from
index a90a1a7cc41ac9c5ccd8c4144f1ed1b510f0e01b..8eecd35872aae44371d933acbf55affc491901d4 100644 (file)
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-set testfile "inline-bt"
-set srcfile ${testfile}.c
-set srcfile2 "inline-markers.c"
-set fullsrcfile "${srcdir}/${subdir}/${srcfile}"
-set fullsrcfile2 "${srcdir}/${subdir}/${srcfile2}"
-set sources [list ${fullsrcfile} ${fullsrcfile2}]
-set binfile ${objdir}/${subdir}/${testfile}
-
-if  { [gdb_compile ${sources} ${binfile} \
-          executable {debug optimize=-O2 additional_flags=-Winline}] != "" } {
-    untested inline-bt.exp
+standard_testfile .c inline-markers.c
+
+if {[prepare_for_testing $testfile.exp $testfile \
+        [list $srcfile $srcfile2] \
+        {debug optimize=-O2 additional_flags=-Winline}]} {
     return -1
 }
 
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
-
 runto_main
 
 get_compiler_info
index ec38d39c4b4a7f6a88d8982a3a4ed8816ac6b814..2a333e0be3708a28c4ed8b7cb7bffc94b1e3e728 100644 (file)
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-set testfile "inline-cmds"
-set srcfile "${testfile}.c"
-set srcfile2 "inline-markers.c"
-set fullsrcfile "${srcdir}/${subdir}/${srcfile}"
-set fullsrcfile2 "${srcdir}/${subdir}/${srcfile2}"
-set sources [list ${fullsrcfile} ${fullsrcfile2}]
-set binfile ${objdir}/${subdir}/${testfile}
-
-if  { [gdb_compile $sources ${binfile} \
-          executable {debug optimize=-O2}] != "" } {
-    untested inline-cmds.exp
+standard_testfile .c inline-markers.c
+
+if {[prepare_for_testing $testfile.exp $testfile \
+        [list $srcfile $srcfile2] {debug optimize=-O2}]} {
     return -1
 }
 
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
-
 gdb_test_no_output "set listsize 1"
 
 runto_main
index 4fbceb0caabef3900dff0c088f62ac24efe41435..7ff6a13b9cffb1fd2ae2b34dd9b00800d6adea6e 100644 (file)
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-set testfile "inline-locals"
-set srcfile ${testfile}.c
-set srcfile2 "inline-markers.c"
-set fullsrcfile "${srcdir}/${subdir}/${srcfile}"
-set fullsrcfile2 "${srcdir}/${subdir}/${srcfile2}"
-set sources [list ${fullsrcfile} ${fullsrcfile2}]
-set binfile ${objdir}/${subdir}/${testfile}
-
-if  { [gdb_compile ${sources} ${binfile} \
-          executable {debug optimize=-O2}] != "" } {
-    untested inline-locals.exp
+standard_testfile .c inline-markers.c
+
+if {[prepare_for_testing $testfile.exp $testfile \
+        [list $srcfile $srcfile2] {debug optimize=-O2}]} {
     return -1
 }
 
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
-
 runto_main
 
 get_compiler_info