xref: /third_party/mesa3d/src/compiler/glsl/tests/warnings/029-fieldselection.vert
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/mesa3d/src/compiler/glsl/tests/warnings/
1bf215546Sopenharmony_ci#version 130
2bf215546Sopenharmony_ci
3bf215546Sopenharmony_cistruct s {
4bf215546Sopenharmony_ci  float c;
5bf215546Sopenharmony_ci  float x;
6bf215546Sopenharmony_ci};
7bf215546Sopenharmony_ci
8bf215546Sopenharmony_civoid main()
9bf215546Sopenharmony_ci{
10bf215546Sopenharmony_ci  float fooFloat;
11bf215546Sopenharmony_ci  s fooStruct;
12bf215546Sopenharmony_ci
13bf215546Sopenharmony_ci  fooFloat = fooStruct.c;
14bf215546Sopenharmony_ci  fooStruct.c = 10.0;
15bf215546Sopenharmony_ci  fooFloat = fooStruct.c;
16bf215546Sopenharmony_ci  fooStruct.c = 20.0;
17bf215546Sopenharmony_ci
18bf215546Sopenharmony_ci  /* Technically .x is also uninitialized, but detecting this is beyond
19bf215546Sopenharmony_ci   * scope. FWIW, gcc doesn't detect this neither.
20bf215546Sopenharmony_ci   */
21bf215546Sopenharmony_ci  fooFloat = fooStruct.x;
22bf215546Sopenharmony_ci}
23bf215546Sopenharmony_ci
24

Indexes created Thu Nov 07 10:32:03 CST 2024