xref: /llvm-project/llvm/test/CodeGen/SPIRV/constant/local-null-constants.ll (revision 67d3ef74b31e1517d4f679e754cc2b3041c95901)
1*67d3ef74SVyacheslav Levytskyy; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv32-unknown-unknown %s -o - | FileCheck %s
2b8e1544bSIlia Diachkov
34bd9d98bSAndrey Tretyakov;; OpenCL global memory
4ec7baca1SMichal Paszkowskidefine ptr addrspace(1) @getConstant1() {
5ec7baca1SMichal Paszkowski  ret ptr addrspace(1) null
6b8e1544bSIlia Diachkov}
7b8e1544bSIlia Diachkov
84bd9d98bSAndrey Tretyakov;; OpenCL constant memory
9ec7baca1SMichal Paszkowskidefine ptr addrspace(2) @getConstant2() {
10ec7baca1SMichal Paszkowski  ret ptr addrspace(2) null
11b8e1544bSIlia Diachkov}
12b8e1544bSIlia Diachkov
134bd9d98bSAndrey Tretyakov;; OpenCL local memory
14ec7baca1SMichal Paszkowskidefine ptr addrspace(3) @getConstant3() {
15ec7baca1SMichal Paszkowski  ret ptr addrspace(3) null
16b8e1544bSIlia Diachkov}
17b8e1544bSIlia Diachkov
18ec7baca1SMichal Paszkowski; CHECK:     [[INT:%.+]] = OpTypeInt 8
19b8e1544bSIlia Diachkov
20b8e1544bSIlia Diachkov; CHECK-DAG: [[PTR_AS1:%.+]] = OpTypePointer CrossWorkgroup [[INT]]
21b8e1544bSIlia Diachkov; CHECK-DAG: OpConstantNull [[PTR_AS1]]
22b8e1544bSIlia Diachkov
23b8e1544bSIlia Diachkov; CHECK-DAG: [[PTR_AS2:%.+]] = OpTypePointer UniformConstant [[INT]]
24b8e1544bSIlia Diachkov; CHECK-DAG: OpConstantNull [[PTR_AS2]]
25b8e1544bSIlia Diachkov
26b8e1544bSIlia Diachkov; CHECK-DAG: [[PTR_AS3:%.+]] = OpTypePointer Workgroup [[INT]]
27b8e1544bSIlia Diachkov; CHECK-DAG: OpConstantNull [[PTR_AS3]]
28