diff options
Diffstat (limited to 'src/compiler/glsl/tests/warnings/029-fieldselection.vert')
-rw-r--r-- | src/compiler/glsl/tests/warnings/029-fieldselection.vert | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/compiler/glsl/tests/warnings/029-fieldselection.vert b/src/compiler/glsl/tests/warnings/029-fieldselection.vert new file mode 100644 index 00000000000..cdec06aed44 --- /dev/null +++ b/src/compiler/glsl/tests/warnings/029-fieldselection.vert @@ -0,0 +1,23 @@ +#version 130 + +struct s { + float c; + float x; +}; + +void main() +{ + float fooFloat; + s fooStruct; + + fooFloat = fooStruct.c; + fooStruct.c = 10.0; + fooFloat = fooStruct.c; + fooStruct.c = 20.0; + + /* Technically .x is also uninitialized, but detecting this is beyond + * scope. FWIW, gcc doesn't detect this neither. + */ + fooFloat = fooStruct.x; +} + |