Comma operator on DSL statements now creates unscoped blocks
Change-Id: I9eb85f25431b2d59b26e8cf8f4a73b9e45faa916
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/398017
Reviewed-by: John Stiles <johnstiles@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
diff --git a/tests/SkSLDSLTest.cpp b/tests/SkSLDSLTest.cpp
index 7d8d9e4..6b837ad 100644
--- a/tests/SkSLDSLTest.cpp
+++ b/tests/SkSLDSLTest.cpp
@@ -1016,6 +1016,9 @@
Var a(kInt_Type, "a", 1), b(kInt_Type, "b", 2);
Statement y = Block(Declare(a), Declare(b), a = b);
EXPECT_EQUAL(y, "{ int a = 1; int b = 2; (a = b); }");
+
+ Statement z = (If(a > 0, --a), ++b);
+ EXPECT_EQUAL(z, "if ((a > 0)) --a; ++b;");
}
DEF_GPUTEST_FOR_MOCK_CONTEXT(DSLBreak, r, ctxInfo) {