| 1 |
; REQUIRES: spirv-as |
| 2 |
; RUN: spirv-as --target-env spv1.0 -o %t.spv %s |
| 3 |
; RUN: spirv-val %t.spv |
| 4 |
; RUN: llvm-spirv -r -o - %t.spv | llvm-dis | FileCheck %s |
| 5 |
OpCapability Addresses |
| 6 |
OpCapability Kernel |
| 7 |
OpMemoryModel Physical32 OpenCL |
| 8 |
OpEntryPoint Kernel %1 "testNullConstants" |
| 9 |
%void = OpTypeVoid |
| 10 |
%bool = OpTypeBool |
| 11 |
%uint = OpTypeInt 32 0 |
| 12 |
%float = OpTypeFloat 32 |
| 13 |
%boolv3 = OpTypeVector %bool 3 |
| 14 |
%uintv3 = OpTypeVector %uint 3 |
| 15 |
%floatv3 = OpTypeVector %float 3 |
| 16 |
%5 = OpTypeFunction %void %bool %boolv3 %uint %uintv3 %float %floatv3 |
| 17 |
%bool0 = OpConstantNull %bool |
| 18 |
%boolv30 = OpConstantNull %boolv3 |
| 19 |
%uint0 = OpConstantNull %uint |
| 20 |
%uintv30 = OpConstantNull %uintv3 |
| 21 |
%float0 = OpConstantNull %float |
| 22 |
%floatv30 = OpConstantNull %floatv3 |
| 23 |
|
| 24 |
%1 = OpFunction %void None %5 |
| 25 |
%pb = OpFunctionParameter %bool |
| 26 |
%pbv3 = OpFunctionParameter %boolv3 |
| 27 |
%pu = OpFunctionParameter %uint |
| 28 |
%puv3 = OpFunctionParameter %uintv3 |
| 29 |
%pf = OpFunctionParameter %float |
| 30 |
%pfv3 = OpFunctionParameter %floatv3 |
| 31 |
%entry = OpLabel |
| 32 |
%tb = OpLogicalEqual %bool %pb %bool0 |
| 33 |
%tbv3 = OpLogicalEqual %boolv3 %pbv3 %boolv30 |
| 34 |
%tu = OpIEqual %bool %pu %uint0 |
| 35 |
%tuv3 = OpIEqual %boolv3 %puv3 %uintv30 |
| 36 |
%tf = OpFOrdEqual %bool %pf %float0 |
| 37 |
%tfv3 = OpFOrdEqual %boolv3 %pfv3 %floatv30 |
| 38 |
OpReturn |
| 39 |
OpFunctionEnd |
| 40 |
|
| 41 |
; CHECK: icmp eq i1 %[[#]], false |
| 42 |
; CHECK: icmp eq <3 x i1> %[[#]], zeroinitializer |
| 43 |
; CHECK: icmp eq i32 %[[#]], 0 |
| 44 |
; CHECK: icmp eq <3 x i32> %[[#]], zeroinitializer |
| 45 |
; CHECK: fcmp oeq float %[[#]], 0.000000e+00 |
| 46 |
; CHECK: fcmp oeq <3 x float> %[[#]], zeroinitializer |