81 lines · plain
1// RUN: %clang_cc1 -finclude-default-header -triple \2// RUN: dxil-pc-shadermodel6.3-library %s \3// RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s4 5//CHECK-LABEL: define hidden noundef i1 @_Z14test_or_scalarbb(6//CHECK-SAME: i1 noundef [[X:%.*]], i1 noundef [[Y:%.*]]) #[[ATTR0:[0-9]+]] {7//CHECK-NEXT: entry:8//CHECK: [[HLSL_OR:%.*]] = or i1 [[A:%.*]], [[B:%.*]]9//CHECK: ret i1 [[HLSL_OR]]10bool test_or_scalar(bool x, bool y)11{12 return or(x, y);13}14 15//CHECK-LABEL: define hidden noundef <2 x i1> @_Z13test_or_bool2Dv2_bS_(16//CHECK-SAME: <2 x i1> noundef [[X:%.*]], <2 x i1> noundef [[Y:%.*]]) #[[ATTR0]] {17//CHECK-NEXT: entry:18//CHECK: [[HLSL_OR:%.*]] = or <2 x i1> [[A:%.*]], [[B:%.*]]19//CHECK: ret <2 x i1> [[HLSL_OR]]20bool2 test_or_bool2(bool2 x, bool2 y)21{22 return or(x, y);23}24 25//CHECK-LABEL: define hidden noundef <3 x i1> @_Z13test_or_bool3Dv3_bS_(26//CHECK-SAME: <3 x i1> noundef [[X:%.*]], <3 x i1> noundef [[Y:%.*]]) #[[ATTR0]] {27//CHECK-NEXT: entry:28//CHECK: [[HLSL_OR:%.*]] = or <3 x i1> [[A:%.*]], [[B:%.*]]29//CHECK: ret <3 x i1> [[HLSL_OR]]30bool3 test_or_bool3(bool3 x, bool3 y)31{32 return or(x, y);33}34 35//CHECK-LABEL: define hidden noundef <4 x i1> @_Z13test_or_bool4Dv4_bS_(36//CHECK-SAME: <4 x i1> noundef [[X:%.*]], <4 x i1> noundef [[Y:%.*]]) #[[ATTR0]] {37//CHECK-NEXT: entry:38//CHECK: [[HLSL_OR:%.*]] = or <4 x i1> [[A:%.*]], [[B:%.*]]39//CHECK: ret <4 x i1> [[HLSL_OR]]40bool4 test_or_bool4(bool4 x, bool4 y)41{42 return or(x, y);43}44 45//CHECK-LABEL: define hidden noundef i1 @_Z11test_or_intii(46//CHECK-SAME: i32 noundef [[X:%.*]], i32 noundef [[Y:%.*]]) #[[ATTR0]] {47//CHECK-NEXT: entry:48//CHECK: [[TOBBOL:%.*]] = icmp ne i32 [[A:%.*]], 049//CHECK: [[TOBBOL1:%.*]] = icmp ne i32 [[B:%.*]], 050//CHECK: [[HLSL_OR:%.*]] = or i1 [[TOBBOL]], [[TOBBOL1]]51//CHECK: ret i1 [[HLSL_OR]]52bool test_or_int(int x, int y)53{54 return or(x, y);55}56 57//CHECK-LABEL: define hidden noundef <4 x i1> @_Z12test_or_int4Dv4_iS_(58//CHECK-SAME: <4 x i32> noundef [[X:%.*]], <4 x i32> noundef [[Y:%.*]]) #[[ATTR0]] {59//CHECK-NEXT: entry:60//CHECK: [[TOBOOL:%.*]] = icmp ne <4 x i32> [[A:%.*]], zeroinitializer61//CHECK: [[TOBOOL1:%.*]] = icmp ne <4 x i32> [[B:%.*]], zeroinitializer62//CHECK: [[HLSL_OR:%.*]] = or <4 x i1> [[TOBOOL]], [[TOBOOL1]]63//CHECK: ret <4 x i1> [[HLSL_OR]]64bool4 test_or_int4(int4 x, int4 y)65{66 return or(x, y);67}68 69//CHECK-LABEL: define hidden noundef <4 x i1> @_Z14test_or_float4Dv4_fS_(70//CHECK-SAME: <4 x float> noundef nofpclass(nan inf) [[X:%.*]], <4 x float> noundef nofpclass(nan inf) [[Y:%.*]]) #[[ATTR0]] {71//CHECK-NEXT: entry:72//CHECK: [[TOBOOL:%.*]] = fcmp reassoc nnan ninf nsz arcp afn une <4 x float> [[A:%.*]], zeroinitializer73//CHECK: [[TOBOOL1:%.*]] = fcmp reassoc nnan ninf nsz arcp afn une <4 x float> [[B:%.*]], zeroinitializer74//CHECK: [[HLSL_OR:%.*]] = or <4 x i1> [[TOBOOL]], [[TOBOOL1]]75//CHECK: ret <4 x i1> [[HLSL_OR]]76bool4 test_or_float4(float4 x, float4 y)77{78 return or(x, y);79}80 81