tests: filecheck IR after detect-abi inlining

Verify that softfloat helper calls become visible after the helper
inlining phase in `DetectABI`.

Merge the previous tests for softfloat and these new ones in a single
file, since they use the same ground truth file.
This commit is contained in:
Andrea Gussoni
2026-06-03 15:06:14 +02:00
committed by Alessandro Di Federico
parent 57f7e577fe
commit 0ae39d72a2
2 changed files with 49 additions and 26 deletions
@@ -0,0 +1,49 @@
#
# This file is distributed under the MIT License. See LICENSE.md for details.
#
# End-to-end tests that verify the emergence of the softfloat calls, on the same
# `for-floating-point-helpers-inlining` ground truth, at two points of the
# pipeline:
# * `revng.test-floating-point-helpers-inlining-in-enforce-abi`:
# in the `enforce-abi` artifact;
# * `revng.test-floating-point-helpers-inlining-in-detect-abi`:
# right after helper inlining inside `DetectABI::analyzeABI()`.
# We pass the `--debug-names` flag to easily anchor the `CHECK` directives for
# multiple function names.
# The CHECK-64 prefix is used for 64-bit-only tests.
commands:
- type: revng.test-floating-point-helpers-inlining-in-enforce-abi
from:
- type: revng-qa.compiled-with-debug-info
# i386 is excluded until x87 FPU support lands.
filter: for-floating-point-helpers-inlining and !i386
# `revng merge llvm` merges the per-function IR modules emitted by the
# `--tar` artifact into a single module, so we can `FileCheck` them all at
# once.
# The `sed` below strips the `local_` prefix for a coherent FileCheck file.
command: |-
PREFIXES=CHECK ;
[ "$POINTER_SIZE" = "64" ] && PREFIXES=$$PREFIXES,CHECK-64 ;
revng2 quick artifact enforce-abi "$INPUT" --tar -- --debug-names |
revng merge llvm |
sed 's,@local_,@,g' |
FileCheck --check-prefixes=$$PREFIXES "${SOURCE}".filecheck
- type: revng.test-floating-point-helpers-inlining-in-detect-abi
from:
- type: revng-qa.compiled-with-debug-info
# i386 is excluded until x87 FPU support lands.
filter: for-floating-point-helpers-inlining and !i386
# The `sed` below strips the `local_` prefix for a coherent FileCheck file.
command: |-
DUMP="$$(temp)" ;
revng2 quick analyze --analyses=parse-binary,detect-abi "$INPUT"
-- --debug-names
--detect-abi-dump-post-helpers-inlining="$$DUMP"
> /dev/null ;
PREFIXES=CHECK ;
[ "$POINTER_SIZE" = "64" ] && PREFIXES=$$PREFIXES,CHECK-64 ;
sed 's,@local_,@,g' "$$DUMP" |
FileCheck --check-prefixes=$$PREFIXES "${SOURCE}".filecheck
@@ -1,26 +0,0 @@
#
# This file is distributed under the MIT License. See LICENSE.md for details.
#
# End-to-end tests which verify the emergence of the softfloat calls in the
# `enforce-abi` artifact.
# We pass the `--debug-names` flag to easily anchor the `CHECK` directives for
# multiple function names.
# We also strip the `local_` prefix to have a more coherent FileCheck file.
# Since we use the `revng2` pipeline, we need to extract all the generated IRs
# for each isolated function and to concatenated their content to easily match
# the CHECK directives.
# The CHECK-64 prefix is used for 64-bit arch only tests.
commands:
- type: revng.floating-point
from:
- type: revng-qa.compiled-with-debug-info
filter: for-floating-point and !i386
command: |-
PREFIXES=CHECK;
file "$INPUT" | grep -q "ELF 64-bit" && PREFIXES="$$PREFIXES,CHECK-64";
revng2 quick artifact enforce-abi "$INPUT" --tar -- --debug-names |
revng merge llvm |
sed 's,@local_,@,g' |
FileCheck --check-prefixes=$$PREFIXES "${SOURCE}".filecheck;