Update tests to (Foo) { ... } syntax.

This commit is contained in:
Christoffer Lerno
2025-02-18 18:53:30 +01:00
parent 168c11e006
commit cbacd64987
98 changed files with 449 additions and 551 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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()

View File

@@ -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()
{