skia2/resources/sksl/shared/EmptyBlocks.sksl
John Stiles 0ecfdea199 Add SkSL unit test for unbraced blocks that optimize away.
In most cases, this works properly and a `;` is emitted, but in one
particular case (int x, y;) we get nothing.

Change-Id: If88d92502f6a533284dd4e0f78daedaf1481ff3d
Bug: skia:11218
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/359558
Commit-Queue: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
2021-01-26 19:06:41 +00:00

18 lines
436 B
Plaintext

half4 main() {
half4 color = half4(0, 0, 0, 0);
for (int counter=0; counter<10; ++counter) int x;
for (int counter=0; counter<10; ++counter) int y, z;
for (int counter=0; counter<10; ++counter) true;
if (sqrt(1) == 1) color.g = 1; else 1;
if (sqrt(1) == 2) 0; else color.a = 1;
if (sqrt(1) == 3) 0; else 1;
while (sqrt(1) == 2) 1 + 2 + 3;
do 1 * 2 * 3; while (sqrt(1) == 2);
return color;
}