diff --git a/tests/integration/src/rust_masm_tests/rust_sdk/mod.rs b/tests/integration/src/rust_masm_tests/rust_sdk/mod.rs index b3b5440bc..277b612da 100644 --- a/tests/integration/src/rust_masm_tests/rust_sdk/mod.rs +++ b/tests/integration/src/rust_masm_tests/rust_sdk/mod.rs @@ -99,24 +99,6 @@ impl Note { test.compile_package(); } -/// Regression test for https://github.com/0xMiden/compiler/issues/831 -/// -/// Previously, compilation could panic during MASM codegen with: -/// `invalid stack offset for movup: 16 is out of range`. -#[test] -fn rust_sdk_invalid_stack_offset_movup_16_issue_831() { - let config = WasmTranslationConfig::default(); - let mut test = CompilerTest::rust_source_cargo_miden( - "../rust-apps-wasm/rust-sdk/issue-invalid-stack-offset-movup", - config, - [], - ); - - // Ensure the crate compiles all the way to a package. This previously triggered the #831 - // panic in MASM codegen. - let package = test.compile_package(); -} - #[test] fn rust_sdk_cross_ctx_account_and_note() { let config = WasmTranslationConfig::default(); diff --git a/tests/lit/swapp/codegen_succeeds.masm b/tests/lit/swapp/codegen_succeeds.masm new file mode 100644 index 000000000..0385809c1 --- /dev/null +++ b/tests/lit/swapp/codegen_succeeds.masm @@ -0,0 +1,8 @@ +;; Regression test for https://github.com/0xMiden/compiler/issues/831 +;; +;; Previously, compilation could panic during MASM codegen with: +;; `invalid stack offset for movup: 16 is out of range`. +;; +;; RUN: env CARGO_TARGET_DIR=%target_dir/lit/swapp cargo miden build --release --manifest-path %S/test-project/Cargo.toml 2>&1 | filecheck %s + +;; CHECK-NOT: error diff --git a/tests/lit/swapp/issue831.masm b/tests/lit/swapp/issue831.masm new file mode 100644 index 000000000..fc8ff8bbb --- /dev/null +++ b/tests/lit/swapp/issue831.masm @@ -0,0 +1,8 @@ +;; Regression test for https://github.com/0xMiden/compiler/issues/831 +;; +;; Verifies that compilation does not panic with: +;; `invalid stack offset for movup: 16 is out of range` +;; +;; RUN: env CARGO_TARGET_DIR=%target_dir/lit/swapp cargo miden build --release --manifest-path %S/test-project/Cargo.toml 2>&1 | filecheck %s + +;; CHECK-NOT: invalid stack offset for movup: 16 is out of range diff --git a/tests/lit/swapp/lit.suite.toml b/tests/lit/swapp/lit.suite.toml new file mode 100644 index 000000000..982d54d59 --- /dev/null +++ b/tests/lit/swapp/lit.suite.toml @@ -0,0 +1,5 @@ +name = "swapp" +patterns = ["*.masm"] +working_dir = "../../../" + +[format.shtest] diff --git a/tests/rust-apps-wasm/rust-sdk/issue-invalid-stack-offset-movup/.cargo/config.toml b/tests/lit/swapp/test-project/.cargo/config.toml similarity index 100% rename from tests/rust-apps-wasm/rust-sdk/issue-invalid-stack-offset-movup/.cargo/config.toml rename to tests/lit/swapp/test-project/.cargo/config.toml diff --git a/tests/rust-apps-wasm/rust-sdk/issue-invalid-stack-offset-movup/.gitignore b/tests/lit/swapp/test-project/.gitignore similarity index 100% rename from tests/rust-apps-wasm/rust-sdk/issue-invalid-stack-offset-movup/.gitignore rename to tests/lit/swapp/test-project/.gitignore diff --git a/tests/rust-apps-wasm/rust-sdk/issue-invalid-stack-offset-movup/Cargo.toml b/tests/lit/swapp/test-project/Cargo.toml similarity index 100% rename from tests/rust-apps-wasm/rust-sdk/issue-invalid-stack-offset-movup/Cargo.toml rename to tests/lit/swapp/test-project/Cargo.toml diff --git a/tests/rust-apps-wasm/rust-sdk/issue-invalid-stack-offset-movup/src/lib.rs b/tests/lit/swapp/test-project/src/lib.rs similarity index 100% rename from tests/rust-apps-wasm/rust-sdk/issue-invalid-stack-offset-movup/src/lib.rs rename to tests/lit/swapp/test-project/src/lib.rs