;; Ensure builtin binding isn't removed by unused gl_PerVertex builtin culling when
;; the builtin is used in a function defined after (in the SPIRV) the entry point.
;;
;; Generated from the following glsl via `glslc` (without `-O` flag):
;;
;; ```glsl
;; #version 450
;;
;; void builtin_usage() {
;;     gl_Position = vec4(
;;         (gl_VertexIndex == 0) ? -4.0 : 1.0,
;;         (gl_VertexIndex == 2) ? 4.0 : -1.0,
;;         0.0,
;;         1.0
;;     );
;; }
;;
;; void main()
;; {
;;     builtin_usage();
;; }
;; ```
;;
; SPIR-V
; Version: 1.0
; Generator: Google Shaderc over Glslang; 11
; Bound: 37
; Schema: 0
               OpCapability Shader
          %1 = OpExtInstImport "GLSL.std.450"
               OpMemoryModel Logical GLSL450
               OpEntryPoint Vertex %main "main" %_ %gl_VertexIndex
               OpSource GLSL 450
               OpSourceExtension "GL_GOOGLE_cpp_style_line_directive"
               OpSourceExtension "GL_GOOGLE_include_directive"
               OpName %main "main"
               OpName %builtin_usage_ "builtin_usage("
               OpName %gl_PerVertex "gl_PerVertex"
               OpMemberName %gl_PerVertex 0 "gl_Position"
               OpMemberName %gl_PerVertex 1 "gl_PointSize"
               OpMemberName %gl_PerVertex 2 "gl_ClipDistance"
               OpMemberName %gl_PerVertex 3 "gl_CullDistance"
               OpName %_ ""
               OpName %gl_VertexIndex "gl_VertexIndex"
               OpMemberDecorate %gl_PerVertex 0 BuiltIn Position
               OpMemberDecorate %gl_PerVertex 1 BuiltIn PointSize
               OpMemberDecorate %gl_PerVertex 2 BuiltIn ClipDistance
               OpMemberDecorate %gl_PerVertex 3 BuiltIn CullDistance
               OpDecorate %gl_PerVertex Block
               OpDecorate %gl_VertexIndex BuiltIn VertexIndex
       %void = OpTypeVoid
          %3 = OpTypeFunction %void
      %float = OpTypeFloat 32
    %v4float = OpTypeVector %float 4
       %uint = OpTypeInt 32 0
     %uint_1 = OpConstant %uint 1
%_arr_float_uint_1 = OpTypeArray %float %uint_1
%gl_PerVertex = OpTypeStruct %v4float %float %_arr_float_uint_1 %_arr_float_uint_1
%_ptr_Output_gl_PerVertex = OpTypePointer Output %gl_PerVertex
          %_ = OpVariable %_ptr_Output_gl_PerVertex Output
        %int = OpTypeInt 32 1
      %int_0 = OpConstant %int 0
%_ptr_Input_int = OpTypePointer Input %int
%gl_VertexIndex = OpVariable %_ptr_Input_int Input
       %bool = OpTypeBool
   %float_n4 = OpConstant %float -4
    %float_1 = OpConstant %float 1
      %int_2 = OpConstant %int 2
    %float_4 = OpConstant %float 4
   %float_n1 = OpConstant %float -1
    %float_0 = OpConstant %float 0
%_ptr_Output_v4float = OpTypePointer Output %v4float
       %main = OpFunction %void None %3
          %5 = OpLabel
         %36 = OpFunctionCall %void %builtin_usage_
               OpReturn
               OpFunctionEnd
%builtin_usage_ = OpFunction %void None %3
          %7 = OpLabel
         %20 = OpLoad %int %gl_VertexIndex
         %22 = OpIEqual %bool %20 %int_0
         %25 = OpSelect %float %22 %float_n4 %float_1
         %26 = OpLoad %int %gl_VertexIndex
         %28 = OpIEqual %bool %26 %int_2
         %31 = OpSelect %float %28 %float_4 %float_n1
         %33 = OpCompositeConstruct %v4float %25 %31 %float_0 %float_1
         %35 = OpAccessChain %_ptr_Output_v4float %_ %int_0
               OpStore %35 %33
               OpReturn
               OpFunctionEnd
