Add BPF-to-BPF and PC relative call tests (#2395)
This commit is contained in:
16
programs/bpf/c/src/relative_call/relative_call.c
Normal file
16
programs/bpf/c/src/relative_call/relative_call.c
Normal file
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* @brief test program that generates BPF PC relative call instructions
|
||||
*/
|
||||
|
||||
#include <solana_sdk.h>
|
||||
|
||||
void __attribute__ ((noinline)) helper() {
|
||||
sol_log(__func__);
|
||||
}
|
||||
|
||||
extern bool entrypoint(const uint8_t *input) {
|
||||
sol_log(__func__);
|
||||
helper();
|
||||
return true;
|
||||
}
|
||||
|
@@ -1,11 +0,0 @@
|
||||
#include <criterion/criterion.h>
|
||||
#include "../src/bench_alu.c"
|
||||
|
||||
Test(bench_alu, sanity) {
|
||||
uint64_t input[] = {500, 0};
|
||||
|
||||
cr_assert(entrypoint((uint8_t *) input));
|
||||
|
||||
cr_assert_eq(input[0], 500);
|
||||
cr_assert_eq(input[1], 5);
|
||||
}
|
Reference in New Issue
Block a user