Skip to content

Commit

Permalink
TEST: WASM_X64: Add and enable test for float
Browse files Browse the repository at this point in the history
  • Loading branch information
Shaikh-Ubaid committed Jan 8, 2023
1 parent ee4b00e commit 6a684f5
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
2 changes: 2 additions & 0 deletions integration_tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -407,4 +407,6 @@ RUN(NAME func_static_02 LABELS cpython llvm c wasm)
RUN(NAME func_dep_03 LABELS cpython llvm c)
RUN(NAME func_dep_04 LABELS cpython llvm c)

RUN(NAME float_01 LABELS cpython llvm wasm wasm_x64)

RUN(NAME test_argv_01 LABELS llvm) # TODO: Test using CPython
25 changes: 25 additions & 0 deletions integration_tests/float_01.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
from ltypes import f64

def sqr(x: f64) -> f64:
return x * x

def computeCircleArea(radius: f64) -> f64:
pi: f64 = 3.14
return pi * sqr(radius)

def main0():
x: f64 = 213.512
y: f64 = 55.23
print(x)
print(y)
print(x + y)
print(x * y)
print(x - y)
print(x / y)
print(computeCircleArea(5.0))
print(computeMean(2.0, 7.0, 10.0))

def computeMean(a: f64, b: f64, c: f64) -> f64:
return (a + b + c) / 3.0

main0()

0 comments on commit 6a684f5

Please sign in to comment.