forked from bytecodealliance/wasmtime
-
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.
Merge pull request bytecodealliance#77 from dhil/wasmfx-merge
Merge with upstream
- Loading branch information
Showing
5 changed files
with
114 additions
and
46 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
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
36 changes: 36 additions & 0 deletions
36
cranelift/filetests/filetests/isa/x64/llvm-abi-option-u128.clif
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,36 @@ | ||
test compile precise-output | ||
set enable_llvm_abi_extensions=1 | ||
target x86_64 | ||
|
||
function u0:0(i64) -> i64, i128 system_v { | ||
block0(v0: i64): | ||
v1 = iconst.i64 0x1000_0000_0000_0000 | ||
v2 = iconst.i64 0x2000_0000_0000_0000 | ||
v3 = iconcat v1, v2 | ||
v6 = iconst.i64 1 | ||
return v6, v3 | ||
} | ||
|
||
; VCode: | ||
; pushq %rbp | ||
; movq %rsp, %rbp | ||
; block0: | ||
; movabsq $1152921504606846976, %rdx | ||
; movabsq $2305843009213693952, %rcx | ||
; movl $1, %eax | ||
; movq %rbp, %rsp | ||
; popq %rbp | ||
; ret | ||
; | ||
; Disassembled: | ||
; block0: ; offset 0x0 | ||
; pushq %rbp | ||
; movq %rsp, %rbp | ||
; block1: ; offset 0x4 | ||
; movabsq $0x1000000000000000, %rdx | ||
; movabsq $0x2000000000000000, %rcx | ||
; movl $1, %eax | ||
; movq %rbp, %rsp | ||
; popq %rbp | ||
; retq | ||
|
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,34 @@ | ||
use test_programs::wasi::cli::{stdin, stdout}; | ||
|
||
fn main() { | ||
match std::env::var("PIPED_SIDE") | ||
.expect("piped tests require the PIPED_SIDE env var") | ||
.as_str() | ||
{ | ||
"PRODUCER" => producer(), | ||
"CONSUMER" => consumer(), | ||
side => panic!("unknown piped test side: {side}"), | ||
} | ||
} | ||
|
||
const CHUNK: &[u8] = &[b'a'; 50]; | ||
|
||
fn producer() { | ||
let out = stdout::get_stdout(); | ||
let n = out.check_write().unwrap() as usize; | ||
assert!(n > CHUNK.len()); | ||
out.write(CHUNK).unwrap(); | ||
} | ||
|
||
fn consumer() { | ||
let stdin = stdin::get_stdin(); | ||
let stdin_pollable1 = stdin.subscribe(); | ||
let stdin_pollable2 = stdin.subscribe(); | ||
|
||
// The two pollables are subscribed to the same resource, and must report the same readyness | ||
stdin_pollable1.block(); | ||
assert!(stdin_pollable1.ready() && stdin_pollable2.ready()); | ||
|
||
let bytes = stdin.read(CHUNK.len() as u64).unwrap(); | ||
assert_eq!(&bytes, CHUNK); | ||
} |
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