Commit 83d11a7c authored by Vinson Lee's avatar Vinson Lee
Browse files

glsl-link-bug30552: Add test case to reproduce bug #30552.

parent 09311736
......@@ -566,6 +566,7 @@ add_plain_test(shaders, 'glsl-useprogram-displaylist')
add_plain_test(shaders, 'glsl-vs-point-size')
add_plain_test(shaders, 'glsl-light-model')
add_shader_generic(shaders, 'glsl-link-array-01')
add_plain_test(shaders, 'glsl-link-bug30552')
add_plain_test(shaders, 'glsl-link-empty-prog-01')
add_plain_test(shaders, 'glsl-link-empty-prog-02')
add_plain_test(shaders, 'glsl-link-initializer-01')
......
......@@ -88,6 +88,7 @@ IF (NOT MSVC)
ENDIF (NOT MSVC)
add_executable (glsl-vs-sqrt-zero glsl-vs-sqrt-zero.c)
add_executable (glsl-light-model glsl-light-model.c)
add_executable (glsl-link-bug30552 glsl-link-bug30552.c)
add_executable (glsl-link-empty-prog-01 glsl-link-empty-prog-01.c)
add_executable (glsl-link-empty-prog-02 glsl-link-empty-prog-02.c)
add_executable (glsl-link-initializer-01 glsl-link-initializer-01.c)
......
/*
* Copyright 2010 VMware, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*/
/**
* \file glsl-link-bug30552.c
*
* \author Vinson Lee <vlee@vmware.com>
*/
#include "piglit-util.h"
int piglit_width = 100, piglit_height = 100;
int piglit_window_mode = GLUT_RGB | GLUT_DOUBLE;
enum piglit_result
piglit_display(void)
{
return PIGLIT_FAILURE;
}
void piglit_init(int argc, char **argv)
{
GLint vert;
GLint prog;
GLboolean ok;
if (!GLEW_VERSION_2_0) {
printf("Requires OpenGL 2.0\n");
piglit_report_result(PIGLIT_SKIP);
}
vert =
piglit_compile_shader(GL_VERTEX_SHADER,
"shaders/glsl-link-bug30552.vert");
prog = glCreateProgram();
glAttachShader(prog, vert);
glLinkProgram(prog);
ok = piglit_link_check_status(prog);
piglit_report_result(ok ? PIGLIT_SUCCESS : PIGLIT_FAILURE);
}
vec4 foo(const vec4 v)
{
return vec4(v.x, v.y, 0.0, 0.0);
}
void main()
{
int i;
for (i = 0; i < 1; i++) {
foo(vec4(0.0, 0.0, 0.0, 0.0));
if (true) {
break;
};
}
gl_Position = gl_Vertex;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment