Updated casts (#684)

Cast code rework. Remove llvm_set_bool and friends.
This commit is contained in:
Christoffer Lerno
2022-12-27 14:16:47 +01:00
committed by GitHub
parent e2b4a19c81
commit f46697bc54
72 changed files with 1074 additions and 674 deletions

View File

@@ -0,0 +1,17 @@
module test;
fn void! vector_array_inferred() @test
{
int[<2>] x = { 4, 7 };
int[2] y = x;
int[*] y1 = y;
int[*] y2 = x;
int[<*>] z = x;
int[<*>] w = y;
double[<2>] ww = x;
assert((int[<2>])y == int[<2>]{ 4, 7});
assert((int[<2>])y1 == int[<2>] { 4, 7 });
assert((int[<2>])y2 == int[<2>] { 4, 7 });
assert(z == int[<2>] { 4, 7 });
assert(w == int[<2>] { 4, 7 });
}

View File

@@ -86,13 +86,13 @@ fn void! testi() @test
w = z << y;
assert(w == { 4, 8, 16, -1600 });
w = $$veccompgt(z, y);
assert(w == { -1, 0, 0, -1});
assert(w == { -1, 0, 0, 0});
w = $$veccompge(z, y);
assert(w == { -1, -1, 0, -1 });
assert(w == { -1, -1, 0, 0 });
w = $$veccomplt(z, y);
assert(w == { 0, 0, -1, 0 });
assert(w == { 0, 0, -1, -1 });
w = $$veccomple(z, y);
assert(w == { 0, -1, -1, 0 });
assert(w == { 0, -1, -1, -1 });
w = $$veccompeq(z, y);
assert(w == { 0, -1, 0, 0 });
w = $$veccompne(z, y);