1// [config]
2// expect_result: fail
3// glsl_version: 1.50
4// require_extensions: GL_ARB_shader_subroutine GL_ARB_enhanced_layouts GL_ARB_explicit_uniform_location
5// [end config]
6//
7// From the ARB_explicit_uniform_location spec:
8//
9// "The subroutine functions can be assigned an explicit index in the shader
10// between 0 and MAX_SUBROUTINES minus one."
11
12#version 150
13#extension GL_ARB_shader_subroutine: require
14#extension GL_ARB_enhanced_layouts: require
15#extension GL_ARB_explicit_uniform_location: require
16
17const int start = -3;
18subroutine void func_type();
19
20/* A subroutine matching the above type */
21layout(index = start + 2) subroutine (func_type) void f() {}
22