+2016-02-26 Yao Qi <yao.qi@linaro.org>
+
+ * gdb.reverse/aarch64.c: [__aarch64__] Include arm_neon.h.
+ (testcase_ftype): New.
+ (testcases): New array.
+ (n_testcases): New.
+ (main): Call each element in testcases.
+ * gdb.reverse/aarch64.exp: Remove is_aarch64_target check.
+ (read_testcase): New.
+ Do the tests in a loop.
+
2016-02-25 Yao Qi <yao.qi@linaro.org>
* gdb.base/branches.c: Remove.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
+#if (defined __aarch64__)
#include <arm_neon.h>
+#endif
+#if (defined __aarch64__)
static void
load (void)
{
{
asm ("fcvtzs s0, s0, #1");
}
+#endif
+
+typedef void (*testcase_ftype) (void);
+
+/* Functions testing instruction decodings. GDB will read n_testcases
+ to know how many functions to test. */
+
+static testcase_ftype testcases[] =
+{
+#if (defined __aarch64__)
+ load,
+ move,
+ adv_simd_mod_imm,
+ adv_simd_scalar_index,
+ adv_simd_smlal,
+ adv_simd_vect_shift,
+#endif
+};
+
+static int n_testcases = (sizeof (testcases) / sizeof (testcase_ftype));
int
main ()
{
- load ();
- move ();
- adv_simd_mod_imm ();
- adv_simd_scalar_index ();
- adv_simd_smlal ();
- adv_simd_vect_shift ();
+ int i = 0;
+
+ for (i = 0; i < n_testcases; i++)
+ testcases[i] ();
+
return 0;
}
return
}
-# Test aarch64 instruction recording.
-
-if {![is_aarch64_target]} then {
- verbose "Skipping aarch64 instruction recording tests."
- return
-}
-
standard_testfile
if {[prepare_for_testing $testfile.exp $testfile $srcfile \
return
}
+# Read function name from testcases[N].
+
+proc read_testcase { n } {
+ global gdb_prompt
+
+ set result -1
+ gdb_test_multiple "print testcases\[${n}\]" "read name of test case ${n}" {
+ -re "\[$\].*= .*<(.*)>.*$gdb_prompt $" {
+ set result $expect_out(1,string)
+ }
+ -re "$gdb_prompt $" { }
+ }
+
+ return $result
+}
+
# In each function FUNC, GDB turns on process record, and single step
# until program goes to the end of the function. Then, single step
# backward. In each of forward single step and backward single step,
}
}
-test "load"
-test "move"
-test "adv_simd_mod_imm"
-test "adv_simd_scalar_index"
-test "adv_simd_smlal"
-test "adv_simd_vect_shift"
+set n_testcases [get_integer_valueof "n_testcases" 0]
+
+if { ${n_testcases} == 0 } {
+ untested "No test"
+ return 1
+}
+
+for { set i 0 } { ${i} < ${n_testcases} } { incr i } {
+ set testcase [read_testcase $i]
+
+ test $testcase
+}