summaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl/tests/warnings/029-fieldselection.vert
blob: cdec06aed44f76e806ccb53adf4dc19c67945018 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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;
}