Add test for variables of type void.

We should, of course, detect this and report an error.

Change-Id: I42b3be6e714a1f367d3251842506a384f2afe019
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/472447
Auto-Submit: John Stiles <johnstiles@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Osman <brianosman@google.com>
This commit is contained in:
John Stiles 2021-11-16 18:03:31 -05:00 committed by SkCQ
parent 3b1a71caba
commit fe3cfc1d4f
3 changed files with 10 additions and 0 deletions

View File

@ -221,6 +221,7 @@ sksl_error_tests = [
"/sksl/errors/VectorInlinedIndexOutOfRange.sksl",
"/sksl/errors/VectorSlice.sksl",
"/sksl/errors/VertexEarlyReturn.vert",
"/sksl/errors/VoidVariable.sksl",
"/sksl/errors/WhileTypeMismatch.sksl",
]

View File

@ -0,0 +1,5 @@
// Expect 2 errors
void func();
void a;
void b = func();

View File

@ -0,0 +1,4 @@
### Compilation failed:
error: 5: opaque type 'void' cannot use initializer expressions
1 error