mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Updated casts (#684)
Cast code rework. Remove llvm_set_bool and friends.
This commit is contained in:
committed by
GitHub
parent
e2b4a19c81
commit
f46697bc54
17
test/unit/regression/vector_conversion.c3
Normal file
17
test/unit/regression/vector_conversion.c3
Normal 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 });
|
||||
}
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user