38 lines
1.3 KiB
Plaintext
38 lines
1.3 KiB
Plaintext
; REQUIRES: spirv-as
|
|
; RUN: spirv-as --target-env spv1.0 -o %t.spv %s
|
|
; RUN: spirv-val %t.spv
|
|
; RUN: llvm-spirv -r -o - %t.spv | llvm-dis | FileCheck %s
|
|
OpCapability Addresses
|
|
OpCapability Kernel
|
|
OpExtension "SPV_KHR_no_integer_wrap_decoration"
|
|
OpMemoryModel Physical32 OpenCL
|
|
OpEntryPoint Kernel %1 "testIAdd"
|
|
OpName %a "a"
|
|
OpName %b "b"
|
|
OpName %r1 "r1"
|
|
OpName %r2 "r2"
|
|
OpName %r3 "r3"
|
|
OpName %r4 "r4"
|
|
OpDecorate %r2 NoSignedWrap
|
|
OpDecorate %r3 NoUnsignedWrap
|
|
OpDecorate %r4 NoSignedWrap
|
|
OpDecorate %r4 NoUnsignedWrap
|
|
%void = OpTypeVoid
|
|
%uint = OpTypeInt 32 0
|
|
%5 = OpTypeFunction %void %uint %uint
|
|
%1 = OpFunction %void None %5
|
|
%a = OpFunctionParameter %uint
|
|
%b = OpFunctionParameter %uint
|
|
%6 = OpLabel
|
|
%r1 = OpIAdd %uint %a %b
|
|
%r2 = OpIAdd %uint %a %b
|
|
%r3 = OpIAdd %uint %a %b
|
|
%r4 = OpIAdd %uint %a %b
|
|
OpReturn
|
|
OpFunctionEnd
|
|
|
|
; CHECK: %r1 = add i32 %a, %b
|
|
; CHECK: %r2 = add nsw i32 %a, %b
|
|
; CHECK: %r3 = add nuw i32 %a, %b
|
|
; CHECK: %r4 = add nuw nsw i32 %a, %b
|