forked from qmonnet/rbpf
-
Notifications
You must be signed in to change notification settings - Fork 175
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test maximum instructions when callx is valid
- Loading branch information
Showing
1 changed file
with
18 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
@@ -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] | ||
|