diff options
author | Ethan Nicholas <ethannicholas@google.com> | 2017-06-09 13:46:34 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-06-12 14:32:40 +0000 |
commit | b310fd597fc37dee888cfd5a760c4e156af08a6d (patch) | |
tree | 01a9f53a153eabf6945f59bec44f11f3eed1f68d /tests/SkSLGLSLTest.cpp | |
parent | 2ee0f42a4b678529d6d62a2619e66fec5e637412 (diff) |
fixed issue with SkSL dead code elimination
Bug: skia:6747
Change-Id: I8566f0f6822a452167079cca004730ec0db318a8
Reviewed-on: https://skia-review.googlesource.com/19275
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Diffstat (limited to 'tests/SkSLGLSLTest.cpp')
-rw-r--r-- | tests/SkSLGLSLTest.cpp | 18 |
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 |