mirror of
https://github.com/eth-act/ere.git
synced 2026-02-19 11:54:42 -05:00
add openvm basic compile test corpus
This commit is contained in:
11
tests/openvm/compile/basic/Cargo.toml
Normal file
11
tests/openvm/compile/basic/Cargo.toml
Normal file
@@ -0,0 +1,11 @@
|
||||
[package]
|
||||
name = "ere-test-openvm-guest"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
[workspace]
|
||||
|
||||
[dependencies]
|
||||
openvm = { git = "https://github.com/openvm-org/openvm.git", features = [
|
||||
"std",
|
||||
] }
|
||||
14
tests/openvm/compile/basic/src/main.rs
Normal file
14
tests/openvm/compile/basic/src/main.rs
Normal file
@@ -0,0 +1,14 @@
|
||||
use openvm::io::{read, reveal_u32};
|
||||
|
||||
fn main() {
|
||||
let n: u64 = read();
|
||||
let mut a: u64 = 0;
|
||||
let mut b: u64 = 1;
|
||||
for _ in 0..n {
|
||||
let c: u64 = a.wrapping_add(b);
|
||||
a = b;
|
||||
b = c;
|
||||
}
|
||||
reveal_u32(a as u32, 0);
|
||||
reveal_u32((a >> 32) as u32, 1);
|
||||
}
|
||||
Reference in New Issue
Block a user