diff options
author | Ian Romanick <ian.d.romanick@intel.com> | 2012-11-16 16:04:43 -0800 |
---|---|---|
committer | Ian Romanick <ian.d.romanick@intel.com> | 2012-11-26 14:21:50 -0800 |
commit | cdb79aa2576e5221487ddfe1cf529742887143e9 (patch) | |
tree | e6c08aa523ed6550182a67d0f30d1aff0e82a8ec | |
parent | da25e5be65c10ebe4e03ea38725182f3b9a9b757 (diff) |
glsl-es-3.00: Verify that no statment is allowed before the first case in a switch
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
-rw-r--r-- | tests/all.tests | 7 | ||||
-rw-r--r-- | tests/spec/glsl-es-3.00/compiler/no-statement-before-first-case.vert | 24 |
2 files changed, 31 insertions, 0 deletions
diff --git a/tests/all.tests b/tests/all.tests index 4a5c35e6..6a9b9346 100644 --- a/tests/all.tests +++ b/tests/all.tests @@ -824,6 +824,13 @@ for stage in ['vs', 'fs']: spec['glsl-1.40/execution/texelFetch/' + stage + '-texelFetch-' + sampler] = concurrent_test('texelFetch 140 ' + stage + ' ' + sampler) spec['glsl-1.40/execution/texelFetchOffset/' + stage + '-' + sampler] = concurrent_test('texelFetch offset 140 ' + stage + ' ' + sampler) +# Group spec/glsl-es-3.00 +spec['glsl-es-3.00'] = Group() +import_glsl_parser_tests(spec['glsl-es-3.00'], + os.path.join(testsDir, 'spec', 'glsl-es-3.00'), + ['compiler']) + + # Group AMD_conservative_depth spec['AMD_conservative_depth'] = Group() import_glsl_parser_tests(spec['AMD_conservative_depth'], diff --git a/tests/spec/glsl-es-3.00/compiler/no-statement-before-first-case.vert b/tests/spec/glsl-es-3.00/compiler/no-statement-before-first-case.vert new file mode 100644 index 00000000..737fda37 --- /dev/null +++ b/tests/spec/glsl-es-3.00/compiler/no-statement-before-first-case.vert @@ -0,0 +1,24 @@ +#version 300 es + +/* [config] + * expect_result: fail + * glsl_version: 3.00 + * [end config] + * + * Page 80 of the OpenGL ES Shading Language 3.00 spec says: + * + * "No statements are allowed in a switch statement before the first case + * statement." + */ + +uniform int x; + +void main() +{ + switch (x) { + gl_Position = vec4(0.); + default: + gl_Position = vec4(1.); + break; + } +} |