From: Lancelot SIX Date: Sun, 21 Nov 2021 01:55:43 +0000 (+0000) Subject: gdb/testsuite: Remove duplicates from gdb.base/pointers.exp X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=148ac50e89b66c1d7934f464195ba559f5cc8cd0;p=binutils-gdb.git gdb/testsuite: Remove duplicates from gdb.base/pointers.exp When I run the testsuite, I have : Running .../gdb/testsuite/gdb.base/pointers.exp ... DUPLICATE: gdb.base/pointers.exp: pointer assignment Fix by placing the sections with duplication in with_test_prefix blocks. This removes the duplication and gives a better organization the file. Tested on x86_64-linux. Co-Authored-By: Pedro Alves --- diff --git a/gdb/testsuite/gdb.base/pointers.exp b/gdb/testsuite/gdb.base/pointers.exp index 8a26c548515..bca8377637b 100644 --- a/gdb/testsuite/gdb.base/pointers.exp +++ b/gdb/testsuite/gdb.base/pointers.exp @@ -145,18 +145,20 @@ gdb_test "print v_int_pointer < v_int_pointer2" " = $true" \ gdb_test "print v_int_pointer > v_int_pointer2" " = $false" \ "pointer1>pointer2" -gdb_test_no_output "set variable y = *v_int_pointer++" \ - "set y = *v_int_pointer++" -gdb_test "print y" " = 6" "pointer assignment" -gdb_test "print *v_int_pointer" " = 18" "and post-increment" - - +with_test_prefix "post-increment" { + gdb_test_no_output "set variable y = *v_int_pointer++" \ + "set y = *v_int_pointer++" + gdb_test "print y" " = 6" "pointer assignment" + gdb_test "print *v_int_pointer" " = 18" "and post-increment" +} -gdb_test_no_output "set variable y = *--v_int_pointer2" \ - "set y = *--v_int_pointer2" -gdb_test "print y" " = 6" "pointer assignment" -gdb_test "print *v_int_pointer2" " = 6" "and pre-decrement" +with_test_prefix "pre-decrement" { + gdb_test_no_output "set variable y = *--v_int_pointer2" \ + "set y = *--v_int_pointer2" + gdb_test "print y" " = 6" "pointer assignment" + gdb_test "print *v_int_pointer2" " = 6" "and pre-decrement" +} gdb_test_no_output "set variable y =v_int_pointer-v_int_pointer2" \