Skip to content

runtimeverification/mir-semantics-compiletest

Rust UI Tests

This suite consists of single-file Rust programs taken from the Rust compiler's test suite and their MIR representations generated using rustc. Expected outputs are stored in <test-name>.run.stdout and <test-name>.run.stderr. If these files do not exist, the output should be empty.

Tests are compiled with projects target toolchain, and manual update should not occur unless kmir is compatible with that toolchain.

How to use tests

Expected result of running a test case is determined by the header commands in the source code.

Creating MIR files

By default, all the MIR files are created using the following command (with our preferred flags):

-rustc --emit mir -C overflow-checks=off -Zmir-enable-passes=-ConstDebugInfo,-PromoteTemps -o <output_file.mir> <input_file.rs>

Note that due to the - preceding rustc, this will not block if an error is encountered when attempting to compile a test.

To re-create all the MIR files, run:

make clean          # remove all MIR files under subdirectories
make ui-mir         # compile all '.rs' files and emit MIR

Rust toolchain version

nightly-x86_64-unknown-linux-gnu (default)
rustc 1.72.0-nightly (46514218f 2023-06-20)

If using rustup, this can be installed and made default with

rustup default nightly-2023-06-21

About

Test suite for MIR semantics

Resources

License

BSD-3-Clause and 2 other licenses found

Licenses found

BSD-3-Clause
LICENSE
Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 5

Languages