aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/SkSLErrorTest.cpp
diff options
context:
space:
mode:
authorGravatar Ethan Nicholas <ethannicholas@google.com>2016-11-28 16:30:17 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2016-11-28 22:38:47 +0000
commit19671772c1a03bd973fae54dead4defc9ee1d4c3 (patch)
treeb84497e9cf024f7d5dcfec6235ce8838bb25e1d8 /tests/SkSLErrorTest.cpp
parent59f9edb321ea29f7349bd4f13f3473e54831598a (diff)
added support for layout(offset=...) to skslc
BUG=skia: Change-Id: Idc1118503f9703496a0c852f0d8840b26e08b9fb Reviewed-on: https://skia-review.googlesource.com/5283 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Diffstat (limited to 'tests/SkSLErrorTest.cpp')
-rw-r--r--tests/SkSLErrorTest.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/SkSLErrorTest.cpp b/tests/SkSLErrorTest.cpp
index 896b32ccb8..c653072dd1 100644
--- a/tests/SkSLErrorTest.cpp
+++ b/tests/SkSLErrorTest.cpp
@@ -378,4 +378,13 @@ DEF_TEST(SkSLBadCap, r) {
"error: 1: unknown capability flag 'bugFreeDriver'\n1 error\n");
}
+DEF_TEST(SkSLBadOffset, r) {
+ test_failure(r,
+ "struct Bad { layout (offset = 5) int x; } bad; void main() { bad.x = 5; }",
+ "error: 1: offset of field 'x' must be a multiple of 4\n1 error\n");
+ test_failure(r,
+ "struct Bad { int x; layout (offset = 0) int y; } bad; void main() { bad.x = 5; }",
+ "error: 1: offset of field 'y' must be at least 4\n1 error\n");
+}
+
#endif