summaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl/tests/warnings/029-fieldselection.vert
diff options
context:
space:
mode:
authorAlejandro Piñeiro <[email protected]>2016-04-20 10:02:45 +0200
committerAlejandro Piñeiro <[email protected]>2016-05-26 09:19:36 +0200
commit2ed9563e79670ba2430f0827050e9a851fc56e79 (patch)
tree8a5c675d3671301f84d30bc5c74c4ae118a3f68e /src/compiler/glsl/tests/warnings/029-fieldselection.vert
parenteee00274fa330edfa536da039ba9116bdceb9990 (diff)
glsl: add unit tests data vertex/expected outcome for uninitialized warning
v2: fix 025 test. Add three more tests (Ian Romanick) Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/compiler/glsl/tests/warnings/029-fieldselection.vert')
-rw-r--r--src/compiler/glsl/tests/warnings/029-fieldselection.vert23
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;
+}
+