xref: /llvm-project/llvm/test/CodeGen/SPIRV/constant/local-aggregate-constant.ll (revision 67d3ef74b31e1517d4f679e754cc2b3041c95901)
1*67d3ef74SVyacheslav Levytskyy; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv32-unknown-unknown %s -o - | FileCheck %s
2b8e1544bSIlia Diachkov
3b8e1544bSIlia Diachkov%aggregate = type { i8, i32 }
4b8e1544bSIlia Diachkov
5b8e1544bSIlia Diachkovdefine %aggregate @getConstant() {
6b8e1544bSIlia Diachkov  ret %aggregate { i8 1, i32 2 }
7b8e1544bSIlia Diachkov}
8b8e1544bSIlia Diachkov
9b8e1544bSIlia Diachkov; CHECK:     OpName [[GET:%.+]] "getConstant"
10b8e1544bSIlia Diachkov
11b8e1544bSIlia Diachkov; CHECK-DAG: [[I8:%.+]] = OpTypeInt 8
12b8e1544bSIlia Diachkov; CHECK-DAG: [[I32:%.+]] = OpTypeInt 32
13b8e1544bSIlia Diachkov; CHECK-DAG: [[AGGREGATE:%.+]] = OpTypeStruct [[I8]] [[I32]]
14b8e1544bSIlia Diachkov; CHECK-DAG: [[CST_I8:%.+]] = OpConstant [[I8]] 1
15b8e1544bSIlia Diachkov; CHECK-DAG: [[CST_I32:%.+]] = OpConstant [[I32]] 2
16b8e1544bSIlia Diachkov; CHECK-DAG: [[CST_AGGREGATE:%.+]] = OpConstantComposite [[AGGREGATE]] [[CST_I8]] [[CST_I32]]
17b8e1544bSIlia Diachkov
18b8e1544bSIlia Diachkov; CHECK:     [[GET]] = OpFunction [[AGGREGATE]]
19b8e1544bSIlia Diachkov; CHECK:     OpReturnValue [[CST_AGGREGATE]]
20b8e1544bSIlia Diachkov; CHECK:     OpFunctionEnd
21