mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Update tests to (Foo) { ... } syntax.
This commit is contained in:
@@ -6,14 +6,14 @@ fn void main()
|
||||
int[5] a = { 1, 2, 3, 4, 5 };
|
||||
void*[<2>] x = { &a[0], &a[4] };
|
||||
int*[<2>] y = x;
|
||||
int[<2>] result = mem::@gather_aligned(y, bool[<2>] { true, false }, int[<2>]{ 10, 20 }, 4);
|
||||
int[<2>] result = mem::@gather_aligned(y, (bool[<2>]) { true, false }, (int[<2>]){ 10, 20 }, 4);
|
||||
assert(result == { 1, 20});
|
||||
result = mem::gather(y, bool[<2>] { true, false }, int[<2>]{ 10, 20 });
|
||||
result = mem::gather(y, (bool[<2>]) { true, false }, (int[<2>]){ 10, 20 });
|
||||
assert(result == { 1, 20});
|
||||
mem::@scatter_aligned(y, int[<2>]{ 66, 77 }, bool[<2>] { false, true } , 4);
|
||||
assert(a == int[5]{ 1, 2, 3, 4, 77});
|
||||
mem::scatter(y, int[<2>]{ 88, 99 }, bool[<2>] { true, false });
|
||||
assert(a == int[5]{ 88, 2, 3, 4, 77});
|
||||
mem::@scatter_aligned(y, (int[<2>]){ 66, 77 }, (bool[<2>]) { false, true } , 4);
|
||||
assert(a == (int[5]){ 1, 2, 3, 4, 77});
|
||||
mem::scatter(y, (int[<2>]){ 88, 99 }, (bool[<2>]) { true, false });
|
||||
assert(a == (int[5]){ 88, 2, 3, 4, 77});
|
||||
}
|
||||
|
||||
/* #expect: foo.ll
|
||||
|
||||
@@ -4,7 +4,7 @@ import std::math;
|
||||
fn int x(char[<8>] a, char[<8>] b)
|
||||
{
|
||||
bool[<8>] z = a.comp_eq(b);
|
||||
return (char[<8>] { [0..7] = 255 } & (char[<8>])z + ~(char[<8>])z & char[<8>] { 0, 1, 2, 3, 4, 5, 6, 7 }).min();
|
||||
return ((char[<8>]) { [0..7] = 255 } & (char[<8>])z + ~(char[<8>])z & (char[<8>]) { 0, 1, 2, 3, 4, 5, 6, 7 }).min();
|
||||
}
|
||||
|
||||
/* #expect: foo.ll
|
||||
|
||||
@@ -5,7 +5,7 @@ import std;
|
||||
// issue 1954
|
||||
macro splat($Type, x)
|
||||
{
|
||||
return $Type {x,x,x,x};
|
||||
return ($Type) {x,x,x,x};
|
||||
}
|
||||
|
||||
fn void main()
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
module test;
|
||||
|
||||
int[<2>] b = (int[<2>])(int[2] { 1, 2 });
|
||||
int[2] c = (int[2])(int[<2>] { 1, 2 });
|
||||
int[<2>] b = (int[<2>])((int[2]) { 1, 2 });
|
||||
int[2] c = (int[2])((int[<2>]) { 1, 2 });
|
||||
|
||||
fn void tester()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user