| 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 -emit-opaque-pointers -o - %t.spv | llvm-dis | FileCheck %s |
| 5 |
OpCapability Addresses |
| 6 |
OpCapability Kernel |
| 7 |
OpExtension "SPV_KHR_no_integer_wrap_decoration" |
| 8 |
OpMemoryModel Physical32 OpenCL |
| 9 |
OpEntryPoint Kernel %1 "testISub" |
| 10 |
OpName %a "a" |
| 11 |
OpName %b "b" |
| 12 |
OpName %r1 "r1" |
| 13 |
OpName %r2 "r2" |
| 14 |
OpName %r3 "r3" |
| 15 |
OpName %r4 "r4" |
| 16 |
OpDecorate %r2 NoSignedWrap |
| 17 |
OpDecorate %r3 NoUnsignedWrap |
| 18 |
OpDecorate %r4 NoSignedWrap |
| 19 |
OpDecorate %r4 NoUnsignedWrap |
| 20 |
%void = OpTypeVoid |
| 21 |
%uint = OpTypeInt 32 0 |
| 22 |
%5 = OpTypeFunction %void %uint %uint |
| 23 |
%1 = OpFunction %void None %5 |
| 24 |
%a = OpFunctionParameter %uint |
| 25 |
%b = OpFunctionParameter %uint |
| 26 |
%6 = OpLabel |
| 27 |
%r1 = OpISub %uint %a %b |
| 28 |
%r2 = OpISub %uint %a %b |
| 29 |
%r3 = OpISub %uint %a %b |
| 30 |
%r4 = OpISub %uint %a %b |
| 31 |
OpReturn |
| 32 |
OpFunctionEnd |
| 33 |
|
| 34 |
; CHECK: %r1 = sub i32 %a, %b |
| 35 |
; CHECK: %r2 = sub nsw i32 %a, %b |
| 36 |
; CHECK: %r3 = sub nuw i32 %a, %b |
| 37 |
; CHECK: %r4 = sub nuw nsw i32 %a, %b |