Skip to content

Commit

Permalink
cranelift: Add LibCall tests
Browse files Browse the repository at this point in the history
  • Loading branch information
afonso360 committed Aug 24, 2022
1 parent 1364ad2 commit 1eb3ac8
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions cranelift/filetests/filetests/runtests/call_libcall.clif
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
test run
target x86_64
target aarch64
target aarch64 sign_return_address
target aarch64 has_pauth sign_return_address
target s390x


function %libcall_ceilf32(f32) -> f32 {
fn0 = %CeilF32(f32) -> f32

block0(v0: f32):
v1 = call fn0(v0)
return v1
}
; run: %libcall_ceilf32(0x0.5) == 0x1.0


function %libcall_indirect_ceilf32(f32) -> f32 {
fn0 = %CeilF32(f32) -> f32
; sig0 = (f32) -> f32

block0(v0: f32):
v1 = func_addr.i64 fn0
v2 = call_indirect.i64 sig0, v1(v0)
return v2
}
; run: %libcall_indirect_ceilf32(0x0.5) == 0x1.0

0 comments on commit 1eb3ac8

Please sign in to comment.