]> git.tdb.fi Git - libs/gl.git/blobdiff - tests/glsl/function_inline_name_conflict.glsl
Add a unit test framework and some tests for the GLSL compiler
[libs/gl.git] / tests / glsl / function_inline_name_conflict.glsl
diff --git a/tests/glsl/function_inline_name_conflict.glsl b/tests/glsl/function_inline_name_conflict.glsl
new file mode 100644 (file)
index 0000000..93c4eca
--- /dev/null
@@ -0,0 +1,24 @@
+#pragma MSP stage(vertex)
+layout(location=0) in vec4 position;
+layout(location=1) in float scale;
+float func()
+{
+       float s = scale*2.0;
+       return s*s;
+}
+void main()
+{
+       float s = scale+1.0;
+       gl_Position = position*func()*s*s;
+}
+
+/* Expected output: vertex
+layout(location=0) in vec4 position;
+layout(location=1) in float scale;
+void main()
+{
+       float s = scale+1.0;
+       float _func_s = scale*2.0;
+       gl_Position = position*_func_s*_func_s*s*s;
+}
+*/