From 19671772c1a03bd973fae54dead4defc9ee1d4c3 Mon Sep 17 00:00:00 2001 From: Ethan Nicholas Date: Mon, 28 Nov 2016 16:30:17 -0500 Subject: added support for layout(offset=...) to skslc BUG=skia: Change-Id: Idc1118503f9703496a0c852f0d8840b26e08b9fb Reviewed-on: https://skia-review.googlesource.com/5283 Reviewed-by: Greg Daniel Commit-Queue: Ethan Nicholas --- tests/SkSLErrorTest.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tests/SkSLErrorTest.cpp') 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 -- cgit v1.2.3