Skip to content

Write tests for kmir run with basic computations and control flow #166

Closed
@yanliu18

Description

@yanliu18

The purpose is to implement milestone 3, enable kmir on executing basic computations.
The tests should be written in Rust suface syntax (refer to the pattern described by @geo2a) and compile to MIR using rustc (nightly version) options such as

rustc prog.rs --emit=mir -Zmir-enable-passes=-ConstDebugInfo,-PromoteTemps -C debug-assertions=off

Using the two flags to avoid syntax we do not support right now and to turn off the debug mode (options to resemble the production code, refer to Discussion in #65 for more details.)

In particular, we should be able to test

  1. the operations defined in Rvalue, NullaryOp, UnaryOp, BinaryOp with CheckedBinaryOp as optional (This would require refining the implementation of AssertKind).
  2. the basic control flow structures sequential, conditions, switch with optional support for loops. Though there is no explicit support for the common control flow structures in MIR, it has Switch and -> commands to support the control flow. We might want to the surface syntax to test the coverage.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kmir-testsAdding/updating tests in KMIRmir-semanticsMIR semantics in K

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions