Files
binutils-gdb/libsframe/testsuite/libsframe.decode/decode.exp
Indu Bhagat 55575b6058 [SFrame-V3] libsframe: testsuite: add new testcases for SFRAME_FDE_TYPE_FLEX
This patch adds two new tests for SFrame V3 changes, focusing on the
newly added flexible FDE TYPE SFRAME_FDE_TYPE_FLEX.

Following tests are added:
  - be-flipping-v3.c: Validates that big-endian SFrame V3 data is
    correctly endian flipped when run on little-endian hosts.  It
    verifies the decoding of CFA offsets and the new V3 register/offset
    metadata bitfields using the SFRAME_V3_FLEX_FDE_OFFSET_REG_* macros.
  - findfre-flex-1.c: Tests a variety of sframe_find_fre lookup
    scenarios, apart from checking the basic encoder/decoder APIs.

Documentation for the binary test data DATA-BE-V3 is provided in
README-be-flipping-v3 to ensure reproducibility.

libsframe/
	* Makefile.in: Regenerate.
	* testsuite/libsframe.decode/DATA-BE-V3: New test data.
	* testsuite/libsframe.decode/README-be-flipping-v3: New file.
	* testsuite/libsframe.decode/be-flipping-v3.c: New test.
	* testsuite/libsframe.decode/decode.exp: Run be-flipping-v3.
	* testsuite/libsframe.decode/local.mk: Add be-flipping-v3.
	* testsuite/libsframe.find/find.exp: Run findfre-flex-1.
	* testsuite/libsframe.find/findfre-flex-1.c: New test.
	* testsuite/libsframe.find/local.mk: Add findfre-flex-1.
2026-01-15 17:02:28 -08:00

63 lines
2.0 KiB
Plaintext

# Copyright (C) 2022-2026 Free Software Foundation, Inc.
#
# This file is part of the GNU Binutils.
#
# 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
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
# MA 02110-1301, USA.
#
load_lib dejagnu.exp
# Run the tests only if compatible dejagnu gcc pair is found
if [string equal $COMPAT_DEJAGNU "no"] {
verbose -log "SFrame testsuite needs perhaps a more recent DejaGnu"
unsupported be-flipping
unsupported frecnt-1
unsupported frecnt-2
return;
}
catch "exec ln -s $srcdir/libsframe.decode/DATA1 ." status
catch "exec ln -s $srcdir/libsframe.decode/DATA2 ." status
catch "exec ln -s $srcdir/libsframe.decode/DATA-V2 ." status
catch "exec ln -s $srcdir/libsframe.decode/DATA-BE ." status
catch "exec ln -s $srcdir/libsframe.decode/DATA-BE-V3 ." status
if { [host_execute "testsuite/libsframe.decode/be-flipping"] ne "" } {
fail "be-flipping"
}
if { [host_execute "testsuite/libsframe.decode/be-flipping-v3"] ne "" } {
fail "be-flipping-v3"
}
if { [host_execute "testsuite/libsframe.decode/frecnt-1"] ne "" } {
fail "frecnt-1"
}
if { [host_execute "testsuite/libsframe.decode/frecnt-2"] ne "" } {
fail "frecnt-2"
}
if { [host_execute "testsuite/libsframe.decode/frecnt-v2"] ne "" } {
fail "frecnt-v2"
}
catch "exec rm DATA1" status
catch "exec rm DATA2" status
catch "exec rm DATA-V2" status
catch "exec rm DATA-BE" status
catch "exec rm DATA-BE-V3" status