aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/SkSLGLSLTest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/SkSLGLSLTest.cpp')
-rw-r--r--tests/SkSLGLSLTest.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/SkSLGLSLTest.cpp b/tests/SkSLGLSLTest.cpp
index 678ff13dd3..2ea6c7ec71 100644
--- a/tests/SkSLGLSLTest.cpp
+++ b/tests/SkSLGLSLTest.cpp
@@ -1375,4 +1375,22 @@ DEF_TEST(SkSLDependentInitializers, r) {
"}\n");
}
+DEF_TEST(SkSLDeadLoopVar, r) {
+ test(r,
+ "void main() {"
+ "for (int x = 0; x < 4; ) {"
+ "break;"
+ "}"
+ "}",
+ *SkSL::ShaderCapsFactory::Default(),
+ "#version 400\n"
+ "out vec4 sk_FragColor;\n"
+ "void main() {\n"
+ " for (; true; ) {\n"
+ " break;\n"
+ " }\n"
+ "}\n"
+ );
+}
+
#endif