[PATCH v2] Add strings -n option test case

Jan Beulich jbeulich@suse.com
Tue Sep 29 09:26:50 GMT 2026


(adding v2 to the subject to properly identify the version)

Also, please sen new versions as distinct new threads, not as replies
to earlier versions. See how the versioning isn't possible to determine
at https://sourceware.org/pipermail/binutils/2026-September/thread.html.
The sole thing tagged V2 is _not_ this new patch version.

On 29.09.2026 11:06, pengxu@kylinos.cn wrote:
> --- /dev/null
> +++ b/binutils/testsuite/binutils-all/strings-len.s
> @@ -0,0 +1,12 @@
> +/* Prepare different length of symbols for string -n test */
> +	.section .data
> +.Lstr1:
> +	.asciz "aaa"
> +.Lstr2:
> +	.asciz "bbbb"
> +.Lstr3:
> +	.asciz "ccccc"
> +.Lstr4:
> +	.asciz "dddddddd"
> +.Lstr5:
> +	.asciz "eeeeeeeeeee"

Just to mention: I don't mind the labels you added, but they also serve
no purpose.

> --- a/binutils/testsuite/binutils-all/strings.exp
> +++ b/binutils/testsuite/binutils-all/strings.exp
> @@ -48,3 +48,13 @@ proc test_print_file_name {testfile} {
>  }
>  
>  test_print_file_name $srcdir/$subdir/strings-1.bin
> +
> +set strings_len_tests {
> +    strings-len-default
> +    strings-len-n-5
> +    strings-len-n-7
> +}
> +
> +foreach t $strings_len_tests {
> +    run_dump_test $t
> +}

I still don't understand why this isn't simply

run_dump_test strings-len-default
run_dump_test strings-len-n-5
run_dump_test strings-len-n-7

Okay with at least this aspect adjusted (whether to keep the labels
above is up to you).

Jan


More information about the Binutils mailing list