Unit tests for runtime effect SkSL errors found later in compilation
Forgot to add these when I fixed the bug. Verified that these tests
failed without the fix.
Bug: skia:10593
Change-Id: Ia20fad3cd8e5b0f63ca19946b8314eed49bec2bf
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/309716
Auto-Submit: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
diff --git a/tests/SkRuntimeEffectTest.cpp b/tests/SkRuntimeEffectTest.cpp
index 57a0a32..05b7e55 100644
--- a/tests/SkRuntimeEffectTest.cpp
+++ b/tests/SkRuntimeEffectTest.cpp
@@ -73,6 +73,10 @@
test("in shader child1; in shader child2;",
"color = sample(p.x > 10 ? child1 : child2);",
"expression");
+
+ // Errors that aren't caught until later in the compilation process (during optimize())
+ test("", "return; color.r = color.g;", "unreachable");
+ test("half badFunc() { }", "", "without returning");
}
DEF_TEST(SkRuntimeEffectInvalidColorFilters, r) {