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