glsl: Add warning tests for identifiers with __
authorIan Romanick <ian.d.romanick@intel.com>
Thu, 1 Nov 2018 20:47:58 +0000 (13:47 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Thu, 8 Nov 2018 18:59:53 +0000 (10:59 -0800)
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
src/compiler/glsl/tests/warnings/031-__-in-function-name.vert [new file with mode: 0644]
src/compiler/glsl/tests/warnings/031-__-in-function-name.vert.expected [new file with mode: 0644]

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 (file)
index 0000000..84d643d
--- /dev/null
@@ -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 (file)
index 0000000..1111ee4
--- /dev/null
@@ -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