Add test for structs/interface-blocks with invalid member names.
Structs already handled this appropriately, but interface blocks did not guard against naming their member variables built-in type names like "float" or "bool". Change-Id: I12ec054b3f158b83e35031449cf2a088ff8d0dc2 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/489596 Auto-Submit: John Stiles <johnstiles@google.com> Reviewed-by: Brian Osman <brianosman@google.com>
This commit is contained in:
parent
f604efbeb4
commit
aa09c782a8
@ -66,6 +66,7 @@ sksl_error_tests = [
|
||||
"/sksl/errors/InVarWithInitializerExpression.sksl",
|
||||
"/sksl/errors/IncompleteExpression.sksl",
|
||||
"/sksl/errors/IncompleteFunctionCall.sksl",
|
||||
"/sksl/errors/InterfaceBlockMemberReservedName.sksl",
|
||||
"/sksl/errors/InterfaceBlockReservedName.sksl",
|
||||
"/sksl/errors/InterfaceBlockScope.sksl",
|
||||
"/sksl/errors/InterfaceBlockStorageModifiers.sksl",
|
||||
@ -194,6 +195,7 @@ sksl_error_tests = [
|
||||
"/sksl/errors/StaticSwitchWithConditionalBreak.sksl",
|
||||
"/sksl/errors/StaticSwitchWithConditionalContinue.sksl",
|
||||
"/sksl/errors/StaticSwitchWithConditionalReturn.sksl",
|
||||
"/sksl/errors/StructMemberReservedName.sksl",
|
||||
"/sksl/errors/StructNameWithoutIdentifier.sksl",
|
||||
"/sksl/errors/StructTooDeeplyNested.sksl",
|
||||
"/sksl/errors/StructVariableReservedName.sksl",
|
||||
|
@ -0,0 +1,7 @@
|
||||
IB {
|
||||
float float;
|
||||
} ib;
|
||||
|
||||
float4 main() {
|
||||
return ib.float.xxxx;
|
||||
}
|
7
resources/sksl/errors/StructMemberReservedName.sksl
Normal file
7
resources/sksl/errors/StructMemberReservedName.sksl
Normal file
@ -0,0 +1,7 @@
|
||||
struct S {
|
||||
float float;
|
||||
} s;
|
||||
|
||||
float4 main() {
|
||||
return s.float.xxxx;
|
||||
}
|
7
tests/sksl/errors/InterfaceBlockMemberReservedName.glsl
Normal file
7
tests/sksl/errors/InterfaceBlockMemberReservedName.glsl
Normal file
@ -0,0 +1,7 @@
|
||||
|
||||
IB {
|
||||
float float;
|
||||
} ib;
|
||||
vec4 main() {
|
||||
return vec4(ib.float);
|
||||
}
|
4
tests/sksl/errors/StructMemberReservedName.glsl
Normal file
4
tests/sksl/errors/StructMemberReservedName.glsl
Normal file
@ -0,0 +1,4 @@
|
||||
### Compilation failed:
|
||||
|
||||
error: 2: expected an identifier, but found type 'float'
|
||||
1 error
|
Loading…
Reference in New Issue
Block a user