; REQUIRES: spirv-as

; RUN: spirv-as %s --target-env spv1.2 -o %t.spv
; RUN: spirv-val %t.spv
; RUN: llvm-spirv -r -o %t.rev.bc %t.spv
; RUN: llvm-dis %t.rev.bc -o - | FileCheck %s

               OpCapability Addresses
               OpCapability Linkage
               OpCapability Kernel
               OpCapability SubgroupDispatch
               OpMemoryModel Physical64 OpenCL
               OpEntryPoint Kernel %fn "testSubgroupsPerWorkgroup"
               OpExecutionMode %fn SubgroupsPerWorkgroup 8
       %void = OpTypeVoid
       %fnTy = OpTypeFunction %void

; CHECK: !spirv.ExecutionMode = !{![[MD:[0-9]+]]}
; CHECK: ![[MD]] = !{ptr @testSubgroupsPerWorkgroup, i32 36, i32 8}

         %fn = OpFunction %void None %fnTy
      %entry = OpLabel
               OpReturn
               OpFunctionEnd
