mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-26 00:39:03 +00:00
Use cl_uint in some SPIR-V tests to avoid UB (#2159)
The following tests under `spirv_new`:
* `op_branch_conditional`
* `op_phi`
* `op_selection_merge`
were using randomly generated `cl_int` values, and storing the
difference between them as a `cl_int`. If one of the generated values is
negative and large enough, while the other is positive and large enough,
the difference then becomes a larger value that cannot be represented
using `cl_int`.
Switch the tests to use `cl_uint` instead, and update the relevant
spvasm{32,64} files to use `OpULessThan` instead of `OpSLessThan`.
Signed-off-by: Ahmed Hesham <ahmed.hesham@arm.com>
This commit is contained in:
@@ -45,7 +45,7 @@
|
||||
%26 = OpInBoundsPtrAccessChain %_ptr_CrossWorkgroup_uint %rhs %23
|
||||
%27 = OpLoad %uint %26 Aligned 4
|
||||
OpStore %19 %uint_0
|
||||
%28 = OpSLessThan %bool %25 %27
|
||||
%28 = OpULessThan %bool %25 %27
|
||||
OpBranchConditional %28 %29 %30
|
||||
%29 = OpLabel
|
||||
%31 = OpISub %uint %27 %25
|
||||
|
||||
Reference in New Issue
Block a user