307 Commits

Author SHA1 Message Date
Andrea Gussoni 0ae39d72a2 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.
2026-06-19 15:35:18 +02:00
Giacomo Vercesi 75059cfdff Port last tests to pypeline
Convert the `revng.test-segregate-stack-accesses` and
`revng.test-detect-stack-size` tests so that they use
the new pipeline.
2026-06-19 15:35:18 +02:00
Giacomo Vercesi 4776a24eb8 tests: use revng merge llvm
Change the code of tests to use the `revng merge llvm` where possible.
2026-06-19 15:35:18 +02:00
Alessandro Di Federico 1ff0eedc5f test-segregate-stack-accesses: test i386 as well 2026-06-19 09:18:15 +02:00
Alessandro Di Federico ffaf735219 sqlite: open read-only when appropriate 2026-06-19 09:18:15 +02:00
Giacomo Vercesi 4f9e811110 pypeline: implement Pypeline Data Viewer
Implement the Pypeline Data Viewer, an HTTP server that allows browsing
the data stored by PRSS.
2026-06-17 17:48:13 +02:00
Ivan Krysak ad8be6819c import-from-c: minor wording improvements 2026-06-16 18:43:45 +02:00
Ivan Krysak 24de1435ff import-from-c: add more tests 2026-06-16 18:43:45 +02:00
Ivan Krysak bbb0a00f46 import-from-c: make output easier to debug 2026-06-16 18:43:45 +02:00
Ivan Krysak 2a97323232 import-from-c: fail on unexpected successes 2026-06-16 18:43:45 +02:00
Ivan Krysak 1609bbe745 Restore the separate enum declaration node 2026-06-16 18:43:45 +02:00
Alessandro Di Federico e4ba9ca989 Drop precedence-tests 2026-06-15 17:28:22 +02:00
Ivan Krysak a7820ae28b Simplify end-to-end c decompilation tests 2026-06-15 17:28:22 +02:00
Ivan Krysak 087ca2ff8c Update forgotten license headers 2026-06-15 17:28:22 +02:00
Ivan Krysak b18bb7e0d5 ImportFromC: handle always_inline and noreturn 2026-06-15 17:28:22 +02:00
Ivan Krysak cabbe4d6e6 Tests: use new header pipes 2026-06-15 17:28:22 +02:00
Ivan Krysak 7214a75379 Precedence test: drop 2026-06-15 17:28:22 +02:00
Ivan Krysak d1f9987523 dual-case test: drop 2026-06-15 17:28:22 +02:00
Ivan Krysak c87513cb37 segments-and-sections test: drop 2026-06-15 17:28:22 +02:00
Ivan Krysak 45d8be8a0f pretty-ints test: drop 2026-06-15 17:28:22 +02:00
Ivan Krysak 277e646d19 linked-lists test: adjust for the new backend 2026-06-15 17:28:22 +02:00
Ivan Krysak a12880aa27 Append legacy- to the old pipes 2026-06-15 17:28:22 +02:00
Alessandro Di Federico 841b5dab71 SegregateStackAccesses: rewrite around ExtraState
Move all per-function state and logic into a new SegregateFunctionStack
worker, so the pass class itself only holds module-wide state and the
runOnFunction body is just upgrade() + segregate(). The discovery loop
now uses the MFP ExtraState surface to capture the analysis value
before each interesting program point, replacing the splitBasicBlock
trick that introduced fake nodes only to read the lattice value at
them.

Other changes that ride along:
- StackOffsetCache memoizes getStackOffset per function.
- findAllWriters does a single sorted sweep instead of a quadratic
  scan over Ranges.
- The pipeline gains a stack-accesses-segregated artifact entry.
- Test fixtures (filecheck.ll, override.yml, segregate-stack-accesses
  configuration) are updated to match the new IR shape.
2026-06-11 17:39:53 +02:00
Pietro Fezzardi 2bc640a5c2 import-from-c tests: make failures actually fail
These tests could pass even when the analysis crashed. The harness
joins the test command into a single shell line, and the diagnostic
block of the error-comparison branch was missing its statement
terminators: it collapsed into a single echo that swallowed `exit 1`,
so the comparison could never fail the test. Moreover, the exit code
of revng2 was only consumed as a boolean, mistaking crashes for
graceful failures, and tests without an expected-error.txt compared
the empty string against the empty RuntimeError payload extracted
from a crash trace, silently passing.

Now the diagnostics are properly terminated, the content of the error
file is printed on mismatch, and the expected-error path requires
exit code 1, an existing expected-error.txt and a non-empty
RuntimeError payload; any other failing outcome dumps stderr and
makes the test fail.
2026-06-10 13:21:17 +02:00
Andrea Gussoni d4f1a717e2 tests: add floating-point end-to-end tests 2026-05-29 17:12:38 +02:00
Giacomo Vercesi 0eebbc912a Add tests for PRSS
Add tests for the PRSS component, these will be run as the `revng-prss`
category.
2026-05-22 15:05:04 +02:00
Giacomo Vercesi 0f319057af pypeline-comparison: avoid sharing the input
When running pypeline comparison tests, copy the `$PWD` to an exclusive
scratch directory, which should eliminate any problems related to the
cache being shared across multiple projects.
2026-05-21 09:55:08 +02:00
Alessandro Di Federico 8e34aa3a3c revng-db: ensure CreateFileA is exported once 2026-05-15 11:43:22 +02:00
Alessandro Di Federico a225d26fa2 import-prototypes-from-db test: import ARM test 2026-05-15 11:43:22 +02:00
Alessandro Di Federico 9bc1e65125 import-prototypes test: merge .yml and .filecheck 2026-05-15 11:43:21 +02:00
Alessandro Di Federico 6e6105e8fe import-prototypes-from-db: add linux/x86-64 test
Smoke test that exercises the linux/x86-64 path: feeds malloc/calloc/
realloc plus a NonExistentFunction through the analysis and asserts that
the typed symbols pick up a prototype while the unknown one does not.
2026-05-15 11:27:33 +02:00
Lauri Vasama a46b3eead9 Remove x86-64 reduce-c-casts test 2026-05-04 10:49:08 +03:00
Alessandro Di Federico 2629f95dd1 Introduce ImportPrototypesFromDatabase
This commit introduces an analysis to import prototypes from a SQLite
database of well-known prototypes, typically built from debug info of
operating systems.

This analysis supersedes import-well-known-models.
2026-04-24 17:54:09 +02:00
Alessandro Di Federico 6894862ef2 Implement platform roots support
Refactor the binary import and dependency resolution infrastructure to
support multiple platforms (Linux, Windows, macOS) via a
configuration-driven root system.

Major changes:

* Overhaul PDB and DWARF importers for platform-aware debug info
  loading.
* Refactor LDDTree into a template-based architecture with
  platform-specific implementations (ELF, PE/COFF).
* Mostly rewrite the PDB importer, which had significant limitations.
2026-04-24 17:54:09 +02:00
Alessandro Di Federico eb9e82477a Introduce WindowsApiSetSchemaParser 2026-04-23 13:40:43 +02:00
Alessandro Di Federico 0385e4c652 Introduce revng::Configuration 2026-04-23 13:40:43 +02:00
Alessandro Di Federico 3a0bbb00c5 verify-abi-test-binaries.sh: limit --use-pdb usage 2026-04-23 13:40:42 +02:00
Alessandro Di Federico d977f26bce import-from-c test: improve error reporting 2026-04-23 13:40:42 +02:00
Pietro Fezzardi 4735dfb460 Fix model-migration.yml: bash negation 2026-04-10 15:27:24 +02:00
Giacomo Vercesi 96f2ad60b4 Fix scripting tests 2026-04-10 11:45:12 +02:00
Giacomo Vercesi ee7ce2d9a3 revng2 quick artifact: use subcommands
Make each artifact a subcommand of `revng2 quick artifact` so that it
behaves the same way as `revng2 project artifact`.
2026-04-10 11:45:12 +02:00
Ivan Krysak 754cfd57fe Model: introduce migration to version 9 2026-03-27 08:19:21 +00:00
Ivan Krysak 16f4be79bb Migration tests: ignore empty lines 2026-03-27 08:18:57 +00:00
Giacomo Vercesi 36f9dfe45b tests: leave TODO in tests to port/drop
Add TODOs to the test yamls of tests that are yet to be ported to the
new pipeline, the new backend or will be removed indefinitely when the
old pipeline is removed.
2026-03-05 14:23:06 +01:00
Giacomo Vercesi 26eca524d0 compare_isolate: exclude attributes
Blank out attribute identifiers and exclude attribute declaration lines,
as they might be swapped between executions.
2026-03-05 14:23:06 +01:00
Giacomo Vercesi 2a5c58791d Port tests to the new pypeline
Port as many tests as possible to use the `revng2`.
2026-03-05 14:23:06 +01:00
Giacomo Vercesi 4757cad690 pipeline-comparison: remove use of {push,pod}d 2026-03-04 14:58:02 +01:00
Ivan Krysak 22fe32afa2 Minor improvements 2026-02-25 12:47:27 +01:00
Giacomo Vercesi 728ee2bb96 Add end-to-end test for --debug 2026-02-16 12:17:56 +01:00
Lauri Vasama aa2597d13b model::Function: add stack frame name and comment
* StackFrameType() is removed.
* StackFrame() is introduced in its place.
* Use StackFrame().Type() to acess the stack frame type.
2026-02-13 08:41:39 +02:00