diff options
Diffstat (limited to 'tests/spec/glsl-1.30/compiler/switch-statement/switch-case-statement.vert')
-rw-r--r-- | tests/spec/glsl-1.30/compiler/switch-statement/switch-case-statement.vert | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/spec/glsl-1.30/compiler/switch-statement/switch-case-statement.vert b/tests/spec/glsl-1.30/compiler/switch-statement/switch-case-statement.vert new file mode 100644 index 000000000..c501219ee --- /dev/null +++ b/tests/spec/glsl-1.30/compiler/switch-statement/switch-case-statement.vert @@ -0,0 +1,29 @@ +// [config] +// expect_result: pass +// glsl_version: 1.30 +// [end config] +// +// From page 57 (page 63 of the PDF) of the GLSL 1.30 spec: +// +// "The type of init-expression in a switch statement must be a scalar +// integer. If a case label has a constant- expression of equal value, +// then execution will continue after that label." +// +// The spec doesn't actually say anything about the type of cases. It only +// says "constant-expression". + +#version 130 + +void main() { + int tmp = 0; + switch (1) { + case 0: + tmp = 1; + break; + default: + tmp = 2; + break; + } + + gl_Position = vec4(0.0); +} |