--- /dev/null
+uniform sampler2D tex;
+
+#pragma MSP stage(vertex)
+layout(location=0) in vec4 vertex;
+layout(location=1) in vec2 texcoord;
+void main()
+{
+ gl_Position = vertex;
+ passthrough;
+}
+
+#pragma MSP stage(fragment)
+layout(location=0) out float result;
+void main()
+{
+ float value = texture(tex, texcoord).r;
+ float pot;
+ for(pot=0; pot<value; pot*=2) { }
+ result = pot;
+}
+
+/* Expected output: vertex
+layout(location=0) in vec4 vertex;
+layout(location=1) in vec2 texcoord;
+layout(location=0) out vec2 _vs_out_texcoord;
+void main()
+{
+ gl_Position = vertex;
+ _vs_out_texcoord = texcoord;
+}
+*/
+
+/* Expected output: fragment
+layout(location=0, binding=71) uniform sampler2D tex;
+layout(location=0) out float result;
+layout(location=0) in vec2 _vs_out_texcoord;
+void main()
+{
+ float value = texture(tex, _vs_out_texcoord).r;
+ float pot;
+ for(pot = 0.0; pot<value; pot *= 2.0) { }
+ result = pot;
+}
+*/