Multi-file BPF C builds (#2393)

This commit is contained in:
Jak May
2019-01-11 15:33:21 -08:00
committed by GitHub
parent 79b334b7f1
commit 23c43ed21b
13 changed files with 129 additions and 38 deletions

View File

@ -0,0 +1,11 @@
#include <criterion/criterion.h>
#include "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);
}

View File

@ -0,0 +1,14 @@
/**
* @brief Example C-based BPF program that prints out the parameters
* passed to it
*/
#include <solana_sdk.h>
#include "helper.h"
extern bool entrypoint(const uint8_t *input) {
sol_log(__FILE__);
helper_function();
sol_log(__FILE__);
return true;
}

View File

@ -0,0 +1,11 @@
/**
* @brief Example C-based BPF program that prints out the parameters
* passed to it
*/
#include <solana_sdk.h>
#include "helper.h"
void helper_function(void) {
sol_log(__FILE__);
}

View File

@ -0,0 +1,7 @@
/**
* @brief Example C-based BPF program that prints out the parameters
* passed to it
*/
#include <solana_sdk.h>
void helper_function(void);

View File

@ -28,3 +28,4 @@ extern bool entrypoint(const uint8_t *input) {
sol_log_params(ka, ka_len, data, data_len);
return true;
}