Skip to content

Commit

Permalink
Test maximum instructions when callx is valid
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasSte committed Nov 8, 2024
1 parent f64404d commit 3408076
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion tests/execution.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#![allow(clippy::arithmetic_side_effects)]
#![cfg(all(feature = "jit", not(target_os = "windows"), target_arch = "x86_64"))]
//#![cfg(all(feature = "jit", not(target_os = "windows"), target_arch = "x86_64"))]
// Copyright 2020 Solana Maintainers <[email protected]>
//
// Licensed under the Apache License, Version 2.0 <http://www.apache.org/licenses/LICENSE-2.0> or
Expand Down Expand Up @@ -3499,6 +3499,23 @@ fn callx_unsupported_instruction_and_exceeded_max_instructions() {
);
}

#[test]
fn test_maximum_after_callx() {
test_interpreter_and_jit_asm!(
"
mov64 r0, 0x0
or64 r8, 0x20
callx r8
exit
function_foo:
mov64 r0, 0x2A
exit",
[],
TestContextObject::new(3),
ProgramResult::Err(EbpfError::ExceededMaxInstructions),
);
}

// SBPFv1 only [DEPRECATED]

#[test]
Expand Down

0 comments on commit 3408076

Please sign in to comment.