Pull in LLVM with stack location fixes (#5732)
This commit is contained in:
4
programs/bpf/rust/param_passing_dep/.gitignore
vendored
Normal file
4
programs/bpf/rust/param_passing_dep/.gitignore
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
/target/
|
||||
|
||||
Cargo.lock
|
||||
/farf/
|
22
programs/bpf/rust/param_passing_dep/Cargo.toml
Normal file
22
programs/bpf/rust/param_passing_dep/Cargo.toml
Normal file
@ -0,0 +1,22 @@
|
||||
|
||||
# Note: This crate must be built using build.sh
|
||||
|
||||
[package]
|
||||
name = "solana-bpf-rust-param-passing-dep"
|
||||
version = "0.19.0-pre0"
|
||||
description = "Solana BPF 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" }
|
||||
|
||||
[dev_dependencies]
|
||||
solana-sdk-bpf-test = { path = "../../../../sdk/bpf/rust/rust-test", version = "0.19.0-pre0" }
|
||||
|
||||
[workspace]
|
||||
members = []
|
6
programs/bpf/rust/param_passing_dep/Xargo.toml
Normal file
6
programs/bpf/rust/param_passing_dep/Xargo.toml
Normal 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" }
|
26
programs/bpf/rust/param_passing_dep/src/lib.rs
Normal file
26
programs/bpf/rust/param_passing_dep/src/lib.rs
Normal file
@ -0,0 +1,26 @@
|
||||
//! @brief Example Rust-based BPF program tests loop iteration
|
||||
|
||||
#![no_std]
|
||||
#![allow(unused_attributes)]
|
||||
|
||||
extern crate solana_sdk_bpf_utils;
|
||||
|
||||
pub struct Data<'a> {
|
||||
pub twentyone: u64,
|
||||
pub twentytwo: u64,
|
||||
pub twentythree: u64,
|
||||
pub twentyfour: u64,
|
||||
pub twentyfive: u32,
|
||||
pub array: &'a [u8],
|
||||
}
|
||||
|
||||
pub struct TestDep {
|
||||
pub thirty: u32,
|
||||
}
|
||||
impl<'a> TestDep {
|
||||
pub fn new(data: &Data<'a>, _one: u64, _two: u64, _three: u64, _four: u64, five: u64) -> Self {
|
||||
Self {
|
||||
thirty: data.twentyfive + five as u32,
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user