Skip to content

Commit

Permalink
test: add operators::chained_negation case
Browse files Browse the repository at this point in the history
  • Loading branch information
ErichDonGubler committed Nov 4, 2022
1 parent 0ce96aa commit de3f802
Show file tree
Hide file tree
Showing 6 changed files with 630 additions and 557 deletions.
9 changes: 9 additions & 0 deletions tests/in/operators.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -318,3 +318,12 @@ fn negate_signed_literals() {
_ = -(-2);
_ = -(- 3);
}

fn chained_negation() {
_ = - -1;
_ = - (-2);
_ = - - -3;
_ = - - - - 4;
_ = - - -(- -5);
_ = (- - - - -6);
}
9 changes: 9 additions & 0 deletions tests/out/glsl/operators.main.Compute.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,15 @@ void negate_signed_literals() {
int unnamed_149 = (-(-3));
}

void chained_negation() {
int unnamed_150 = (-(-1));
int unnamed_151 = (-(-2));
int unnamed_152 = (-(-(-3)));
int unnamed_153 = (-(-(-(-4))));
int unnamed_154 = (-(-(-(-(-5)))));
int unnamed_155 = (-(-(-(-(-6)))));
}

void main() {
vec4 _e4 = builtins();
vec4 _e5 = splat();
Expand Down
10 changes: 10 additions & 0 deletions tests/out/hlsl/operators.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,16 @@ void negate_signed_literals()
int unnamed_149 = (-(-3));
}

void chained_negation()
{
int unnamed_150 = (-(-1));
int unnamed_151 = (-(-2));
int unnamed_152 = (-(-(-3)));
int unnamed_153 = (-(-(-(-4))));
int unnamed_154 = (-(-(-(-(-5)))));
int unnamed_155 = (-(-(-(-(-6)))));
}

[numthreads(1, 1, 1)]
void main()
{
Expand Down
10 changes: 10 additions & 0 deletions tests/out/msl/operators.msl
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,16 @@ void negate_signed_literals(
int unnamed_149 = (-(-3));
}

void chained_negation(
) {
int unnamed_150 = (-(-1));
int unnamed_151 = (-(-2));
int unnamed_152 = (-(-(-3)));
int unnamed_153 = (-(-(-(-4))));
int unnamed_154 = (-(-(-(-(-5)))));
int unnamed_155 = (-(-(-(-(-6)))));
}

kernel void main_(
) {
metal::float4 _e4 = builtins();
Expand Down
Loading

0 comments on commit de3f802

Please sign in to comment.