Add unit test for a dead do-while loop.
Ideally the optimizer should be able to detect and remove this loop. This CL establishes a baseline. Change-Id: I6aba0b52fe49552f170fca25d81c29c515044ef5 Bug: skia:10737 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/317861 Commit-Queue: John Stiles <johnstiles@google.com> Commit-Queue: Brian Osman <brianosman@google.com> Auto-Submit: John Stiles <johnstiles@google.com> Reviewed-by: Brian Osman <brianosman@google.com>
This commit is contained in:
parent
94f65d784c
commit
64fc15a279
@ -123,6 +123,7 @@ sksl_glsl_tests_sources = [
|
||||
"$_tests/sksl/glsl/ConstVariableComparison.sksl",
|
||||
"$_tests/sksl/glsl/ConstantIf.sksl",
|
||||
"$_tests/sksl/glsl/Control.sksl",
|
||||
"$_tests/sksl/glsl/DeadDoWhileLoop.sksl",
|
||||
"$_tests/sksl/glsl/DeadLoopVariable.sksl",
|
||||
"$_tests/sksl/glsl/DependentInitializers.sksl",
|
||||
"$_tests/sksl/glsl/DerivativesUnused.sksl",
|
||||
|
5
tests/sksl/glsl/DeadDoWhileLoop.sksl
Normal file
5
tests/sksl/glsl/DeadDoWhileLoop.sksl
Normal file
@ -0,0 +1,5 @@
|
||||
void main() {
|
||||
do {
|
||||
sk_FragColor = half4(1);
|
||||
} while (false);
|
||||
}
|
7
tests/sksl/glsl/golden/DeadDoWhileLoop.glsl
Normal file
7
tests/sksl/glsl/golden/DeadDoWhileLoop.glsl
Normal file
@ -0,0 +1,7 @@
|
||||
|
||||
out vec4 sk_FragColor;
|
||||
void main() {
|
||||
do {
|
||||
sk_FragColor = vec4(1.0);
|
||||
} while (false);
|
||||
}
|
Loading…
Reference in New Issue
Block a user