1 ; RUN: llc -O0 -mtriple=spirv32-unknown-unknown %s -o - | FileCheck %s
2 ; TODO: %if spirv-tools %{ llc -O0 -mtriple=spirv32-unknown-unknown %s -o - -filetype=obj | spirv-val %}
4 ; CHECK: OpName %[[Arg1:.*]] "arg1"
5 ; CHECK: OpName %[[Arg2:.*]] "arg2"
6 ; CHECK: OpName %[[NotAStaticPoison:.*]] "poison1"
7 ; CHECK: OpName %[[NotAStaticPoison]] "nil0"
8 ; CHECK: OpName %[[StaticPoisonIntFreeze:.*]] "nil1"
9 ; CHECK: OpName %[[StaticPoisonFloatFreeze:.*]] "nil2"
10 ; CHECK: OpName %[[Arg1]] "val1"
11 ; CHECK: OpName %[[Const100:.*]] "val2"
12 ; CHECK: OpName %[[Const100]] "val3"
14 ; CHECK-DAG: %[[FloatTy:.*]] = OpTypeFloat 32
15 ; CHECK-DAG: %[[ShortTy:.*]] = OpTypeInt 16 0
16 ; CHECK-DAG: %[[IntTy:.*]] = OpTypeInt 32 0
17 ; CHECK-DAG: %[[Undef:.*]] = OpUndef %[[ShortTy]]
18 ; CHECK-DAG: %[[Const100]] = OpConstant %[[IntTy]] 100
19 ; CHECK-DAG: %[[StaticPoisonIntFreeze]] = OpConstantNull %[[IntTy]]
20 ; CHECK-DAG: %[[StaticPoisonFloatFreeze]] = OpConstantNull %[[FloatTy]]
21 ; CHECK: %[[Arg1]] = OpFunctionParameter %[[FloatTy]]
22 ; CHECK: %[[NotAStaticPoison]] = OpIAdd %[[ShortTy]] %[[Arg2]] %[[Undef]]
24 target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-n8:16:32:64"
25 target triple = "spir64-unknown-unknown"
27 define spir_func void @foo(float %arg1, i16 %arg2) {
29 %poison1 = add i16 %arg2, undef
30 %nil0 = freeze i16 %poison1
31 %nil1 = freeze i32 undef
32 %nil2 = freeze float poison
33 %val1 = freeze float %arg1
34 %val2 = freeze i32 100
35 %val3 = freeze i32 %val2