diff options
Diffstat (limited to 'tests/SkSLErrorTest.cpp')
-rw-r--r-- | tests/SkSLErrorTest.cpp | 9 |
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 |