2 ;; int square(unsigned short a) {
6 ;; clang -cc1 -triple spir -emit-llvm -O2 -o NoSignedUnsignedWrap.ll test.cl
10 ; RUN: llc -O0 -mtriple=spirv32-unknown-unknown --spirv-extensions=SPV_KHR_no_integer_wrap_decoration %s -o - | FileCheck %s --check-prefixes=CHECK-SPIRV,CHECK-SPIRV-NEGATIVE
14 ;; Check that backend is able to skip nsw/nuw attributes if extension is
15 ;; disabled implicitly or explicitly and if max SPIR-V version is lower then 1.4
17 ; CHECK-SPIRV-DAG: OpDecorate %[[#]] NoSignedWrap
18 ; CHECK-SPIRV-DAG: OpDecorate %[[#]] NoUnsignedWrap
20 ; CHECK-SPIRV-NEGATIVE-NOT: OpExtension "SPV_KHR_no_integer_wrap_decoration"
21 ; CHECK-SPIRV-NEGATIVE-NOT: OpDecorate %[[#]] NoSignedWrap
22 ; CHECK-SPIRV-NEGATIVE-NOT: OpDecorate %[[#]] NoUnsignedWrap
24 define spir_func i32 @square(i16 zeroext %a) local_unnamed_addr {
26 %conv = zext i16 %a to i32
27 %mul = mul nuw nsw i32 %conv, %conv