Skip to content

Commit

Permalink
test: add operators::negate_signed_literals case
Browse files Browse the repository at this point in the history
  • Loading branch information
ErichDonGubler committed Oct 25, 2022
1 parent 5b8a98a commit 0a8b672
Show file tree
Hide file tree
Showing 6 changed files with 585 additions and 548 deletions.
8 changes: 6 additions & 2 deletions tests/in/operators.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,6 @@ fn logical() {

fn arithmetic() {
// unary
// TODO: uncomment when we get the changes from https://github.com/gfx-rs/rspirv/pull/231
// _ = -1;
_ = -1.0;
_ = -vec2(1);
_ = -vec2(1.0);
Expand Down Expand Up @@ -314,3 +312,9 @@ fn main() {
comparison();
assignment();
}

fn negate_signed_literals() {
_ = -1;
_ = -(-2);
_ = -(- 3);
}
5 changes: 5 additions & 0 deletions tests/out/glsl/operators.main.Compute.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,11 @@ void assignment() {
return;
}

void negate_signed_literals() {
int unnamed_148 = (- -2);
int unnamed_149 = (-(-3));
}

void main() {
vec4 _e4 = builtins();
vec4 _e5 = splat();
Expand Down
6 changes: 6 additions & 0 deletions tests/out/hlsl/operators.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,12 @@ void assignment()
return;
}

void negate_signed_literals()
{
int unnamed_148 = - -2;
int unnamed_149 = --3;
}

[numthreads(1, 1, 1)]
void main()
{
Expand Down
6 changes: 6 additions & 0 deletions tests/out/msl/operators.msl
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,12 @@ void assignment(
return;
}

void negate_signed_literals(
) {
int unnamed_148 = - -2;
int unnamed_149 = --3;
}

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

0 comments on commit 0a8b672

Please sign in to comment.