From 2ca2203c56093325456027931b2b59ebe08bae7c Mon Sep 17 00:00:00 2001 From: TheCPP Date: Sat, 19 Oct 2024 07:39:33 +0200 Subject: [PATCH] [FIX] fixing tests --- fp.yl | 21 --------------------- tests/IR/assign/fp0.yl | 16 +++++----------- tests/Optimizations/const_eval/cast0.yl | 2 +- 3 files changed, 6 insertions(+), 33 deletions(-) delete mode 100644 fp.yl diff --git a/fp.yl b/fp.yl deleted file mode 100644 index b5a6efcb..00000000 --- a/fp.yl +++ /dev/null @@ -1,21 +0,0 @@ -# RUN: -cargo run -p ylc -- -in=%s -o=out.o -gcc out.o %s2 -o a.exe -./a.exe - -# IN: -define f32 @add(f32 %0, f32 %1) { - entry: - %2 = add f32 %0, %1 - ret f32 %2 -} - -# IN2: -extern float add(float, float); - -int main() { - float out = add(2.5f, 2.5f); - return (int)out; -} - -# EXIT_CODE=5 \ No newline at end of file diff --git a/tests/IR/assign/fp0.yl b/tests/IR/assign/fp0.yl index 155f3245..d4e796b0 100644 --- a/tests/IR/assign/fp0.yl +++ b/tests/IR/assign/fp0.yl @@ -1,19 +1,13 @@ # RUN: cargo run -p ylc -- -in=%s -o=out.o -gcc out.o %c -o a.exe +gcc out.o -o a.exe ./a.exe # IN: -define f32 @test() { +define i32 @main() { entry: - %return_value = f32 5.0 - ret f32 5 -} - -# IN2: -extern float test(); - -int main() { - return (int)test(); + %val = f32 5.0 + %ret = cast f32 %val to i32 + ret i32 %ret } # EXIT_CODE=5 diff --git a/tests/Optimizations/const_eval/cast0.yl b/tests/Optimizations/const_eval/cast0.yl index d30a2644..fa3c40a0 100644 --- a/tests/Optimizations/const_eval/cast0.yl +++ b/tests/Optimizations/const_eval/cast0.yl @@ -5,7 +5,7 @@ cargo run -p ylc -- -in=%s -O -fmt -passes=cp define i32 @main() { entry: %0 = i32 5 - %1 = cast %0 to i32 + %1 = cast i32 %0 to i32 ret i32 %1 }