Fix test names starting with uppercase output by basic functions
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.arch / arm-disp-step.exp
index 5e04f05542c7cc0d13fe69f10138274c9a6c46c1..c038551d144bdb49d6e2cf0c32e3b6def74ce2eb 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 2010-2012 Free Software Foundation, Inc.
+# Copyright 2010-2016 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
 
 # Test arm displaced stepping.
 
-if $tracelevel {
-    strace $tracelevel
-}
-
-if {![istarget "arm*-*-*"]} then {
+if {![is_aarch32_target]} then {
     verbose "Skipping arm displaced stepping tests."
     return
 }
 
-set testfile "arm-disp-step"
-set srcfile ${testfile}.S
-set binfile ${objdir}/${subdir}/${testfile}
+standard_testfile .S
 
 set additional_flags "-Wa,-g"
 
-if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug $additional_flags]] != "" } {
-    untested arm-disp-step.exp
+if { [prepare_for_testing $testfile.exp $testfile $srcfile [list debug $additional_flags]] } {
     return -1
 }
 
@@ -375,9 +368,44 @@ proc test_str_pc {} {
        ".*bx lr.*"
 }
 
-# Get things started.
+# Test 16 bit thumb instruction 'add rd, pc'.
 
-clean_restart ${testfile}
+proc test_add_rn_pc {} {
+    global srcfile gdb_prompt
+
+    set test "break test_add_rn_pc"
+    gdb_test_multiple "break *test_add_rn_pc" $test {
+       -re "Breakpoint.*at.* file .*$srcfile, line.*\r\n$gdb_prompt $" {
+           pass $test
+       }
+       -re "No symbol.*\r\n$gdb_prompt $" {
+           return
+       }
+    }
+
+    gdb_continue_to_breakpoint "continue to test_add_rn_pc" \
+       ".*mov.*r3, 4.*"
+
+    gdb_test "break *test_add_rn_pc_start" \
+       "Breakpoint.*at.* file .*$srcfile, line.*" \
+       "break test_add_rn_pc_start"
+
+    gdb_continue_to_breakpoint "continue to test_add_rn_pc_start" \
+       ".*add.*r3,.*pc.*"
+
+    set pc_val [get_integer_valueof "\$pc" 0]
+
+    gdb_test "break *test_add_rn_pc_end" \
+       "Breakpoint.*at.* file .*$srcfile, line.*" \
+       "break test_add_rn_pc_end"
+
+    gdb_continue_to_breakpoint "continue to test_add_rn_pc_end" \
+       ".*bx lr.*"
+
+    set r3_val [get_integer_valueof "\$r3" 0]
+    # Test the value in r3 is correct.
+    gdb_assert { [expr {$pc_val + 4 + 4} == $r3_val] }
+}
 
 # Turn displaced stepping off before runto main. When displaced stepping
 # is on, and we type 'run', GDB will first try to single step on _dl_debug_state,
@@ -385,7 +413,7 @@ clean_restart ${testfile}
 gdb_test_no_output "set displaced-stepping off"
 
 if ![runto_main] then {
-    fail "Can't run to main"
+    fail "can't run to main"
     return 0
 }
 
@@ -414,6 +442,8 @@ test_pop_pc
 
 test_str_pc
 
+test_add_rn_pc
+
 ##########################################
 
 # Done, run program to exit.
This page took 0.027044 seconds and 4 git commands to generate.