Pull in LLVM with stack location fixes (#5732)

This commit is contained in:
Jack May
2019-08-29 11:25:22 -07:00
committed by GitHub
parent 57f778bcdb
commit 50214f059f
13 changed files with 63 additions and 146 deletions

View File

@ -0,0 +1,4 @@
/target/
Cargo.lock
/farf/

View File

@ -0,0 +1,27 @@
# Note: This crate must be built using build.sh
[package]
name = "solana-bpf-rust-param-passing"
version = "0.19.0-pre0"
description = "Solana BPF test program written in Rust"
authors = ["Solana Maintainers <maintainers@solana.com>"]
repository = "https://github.com/solana-labs/solana"
license = "Apache-2.0"
homepage = "https://solana.com/"
edition = "2018"
[dependencies]
solana-sdk-bpf-utils = { path = "../../../../sdk/bpf/rust/rust-utils", version = "0.19.0-pre0" }
solana-sdk-bpf-no-std = { path = "../../../../sdk/bpf/rust/rust-no-std", version = "0.19.0-pre0" }
solana-bpf-rust-param-passing-dep = { path = "../param_passing_dep", version = "0.19.0-pre0" }
[dev_dependencies]
solana-sdk-bpf-test = { path = "../../../../sdk/bpf/rust/rust-test", version = "0.19.0-pre0" }
[workspace]
members = []
[lib]
crate-type = ["cdylib"]
name = "solana_bpf_rust_param_passing"

View File

@ -0,0 +1,6 @@
[dependencies.compiler_builtins]
path = "../../../../sdk/bpf/dependencies/rust-bpf-sysroot/src/compiler-builtins"
features = ["c", "mem"]
[target.bpfel-unknown-unknown.dependencies]
alloc = { path = "../../../../sdk/bpf/dependencies/rust-bpf-sysroot/src/liballoc" }

View File

@ -0,0 +1,28 @@
//! @brief Example Rust-based BPF program tests loop iteration
#![no_std]
#![allow(unused_attributes)]
#[cfg(not(test))]
extern crate solana_sdk_bpf_no_std;
extern crate solana_sdk_bpf_utils;
use solana_bpf_rust_param_passing_dep::{Data, TestDep};
use solana_sdk_bpf_utils::info;
#[no_mangle]
pub extern "C" fn entrypoint(_input: *mut u8) -> bool {
let array = [0xA, 0xB, 0xC, 0xD, 0xE, 0xF];
let data = Data {
twentyone: 21u64,
twentytwo: 22u64,
twentythree: 23u64,
twentyfour: 24u64,
twentyfive: 25u32,
array: &array,
};
let test_dep = TestDep::new(&data, 1, 2, 3, 4, 5);
info!(0, 0, 0, 0, test_dep.thirty);
test_dep.thirty == 30
}