Mesa (master): glsl: Add warning tests for identifiers with __

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Nov 8 19:01:48 UTC 2018


Module: Mesa
Branch: master
Commit: 011abfc963a734953a0edd9c7a4fa01570627050
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=011abfc963a734953a0edd9c7a4fa01570627050

Author: Ian Romanick <ian.d.romanick at intel.com>
Date:   Thu Nov  1 13:47:58 2018 -0700

glsl: Add warning tests for identifiers with __

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
Reviewed-by: Matt Turner <mattst88 at gmail.com>

---

 .../tests/warnings/031-__-in-function-name.vert    | 22 ++++++++++++++++++++++
 .../warnings/031-__-in-function-name.vert.expected |  3 +++
 2 files changed, 25 insertions(+)

diff --git a/src/compiler/glsl/tests/warnings/031-__-in-function-name.vert b/src/compiler/glsl/tests/warnings/031-__-in-function-name.vert
new file mode 100644
index 0000000000..84d643d450
--- /dev/null
+++ b/src/compiler/glsl/tests/warnings/031-__-in-function-name.vert
@@ -0,0 +1,22 @@
+#version 130
+
+float __foo(float x)
+{
+   return 6.0 * x;
+}
+
+float __bar(float x)
+{
+   return 3.0 * x;
+}
+
+float __blat(float x)
+{
+   return 2.0 * x;
+}
+
+void main()
+{
+   gl_Position = vec4(__foo(gl_Vertex.x), __bar(gl_Vertex.y), __blat(gl_Vertex.z), 1.0);
+}
+
diff --git a/src/compiler/glsl/tests/warnings/031-__-in-function-name.vert.expected b/src/compiler/glsl/tests/warnings/031-__-in-function-name.vert.expected
new file mode 100644
index 0000000000..1111ee4417
--- /dev/null
+++ b/src/compiler/glsl/tests/warnings/031-__-in-function-name.vert.expected
@@ -0,0 +1,3 @@
+0:3(7): warning: identifier `__foo' uses reserved `__' string
+0:8(7): warning: identifier `__bar' uses reserved `__' string
+0:13(7): warning: identifier `__blat' uses reserved `__' string




More information about the mesa-commit mailing list