forked from wildfluss/wasm2llvm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Yakov Zaytsev
committed
Sep 19, 2019
1 parent
f1df903
commit e7a2f4b
Showing
5 changed files
with
1,126 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
target |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[package] | ||
name = "wasm2llvm" | ||
version = "0.1.0" | ||
authors = ["Yakov Zaytsev <[email protected]>"] | ||
edition = "2018" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] | ||
wabt = "0.9.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
extern crate wabt; | ||
|
||
#[cfg(test)] | ||
mod tests { | ||
use wabt::script::{ScriptParser, Command, CommandKind, Action, Value, Error}; | ||
|
||
#[test] | ||
fn it_works() -> Result<(), Error> { | ||
use std::fs; | ||
|
||
let wast = fs::read_to_string("testsuite/i32.wast").unwrap(); | ||
let mut parser: ScriptParser = ScriptParser::from_str(&wast)?; | ||
while let Some(Command { kind, .. }) = parser.next()? { | ||
if let CommandKind::AssertReturn { action, expected } = kind { | ||
if let Action::Invoke { | ||
module, | ||
field, | ||
args | ||
} = action { | ||
println!("{} {:?} {:?}", field, args, expected); | ||
|
||
break; | ||
} | ||
} | ||
} | ||
|
||
Ok(()) | ||
} | ||
} |
Oops, something went wrong.