Debian Codegraph @

clang/test/CodeGenHLSL/builtins/and.hlsl

raw
1 // NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 5
2 // RUN: %clang_cc1 -finclude-default-header -triple \
3 // RUN: dxil-pc-shadermodel6.3-library %s \
4 // RUN: -emit-llvm -O1 -o - | FileCheck %s
5
6 // CHECK-LABEL: define hidden noundef i1 @_Z15test_and_scalarbb(
7 // CHECK-SAME: i1 noundef [[X:%.*]], i1 noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR0:[0-9]+]] {
8 // CHECK-NEXT: [[ENTRY:.*:]]
9 // CHECK-NEXT: [[HLSL_AND:%.*]] = and i1 [[X]], [[Y]]
10 // CHECK-NEXT: ret i1 [[HLSL_AND]]
11 //
12 bool test_and_scalar(bool x, bool y) {
13 return and(x, y);
14 }
15
16 // CHECK-LABEL: define hidden noundef <2 x i1> @_Z14test_and_bool2Dv2_bS_(
17 // CHECK-SAME: <2 x i1> noundef [[X:%.*]], <2 x i1> noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR0]] {
18 // CHECK-NEXT: [[ENTRY:.*:]]
19 // CHECK-NEXT: [[HLSL_AND:%.*]] = and <2 x i1> [[X]], [[Y]]
20 // CHECK-NEXT: ret <2 x i1> [[HLSL_AND]]
21 //
22 bool2 test_and_bool2(bool2 x, bool2 y) {
23 return and(x, y);
24 }
25
26 // CHECK-LABEL: define hidden noundef <3 x i1> @_Z14test_and_bool3Dv3_bS_(
27 // CHECK-SAME: <3 x i1> noundef [[X:%.*]], <3 x i1> noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR0]] {
28 // CHECK-NEXT: [[ENTRY:.*:]]
29 // CHECK-NEXT: [[HLSL_AND:%.*]] = and <3 x i1> [[X]], [[Y]]
30 // CHECK-NEXT: ret <3 x i1> [[HLSL_AND]]
31 //
32 bool3 test_and_bool3(bool3 x, bool3 y) {
33 return and(x, y);
34 }
35
36 // CHECK-LABEL: define hidden noundef <4 x i1> @_Z14test_and_bool4Dv4_bS_(
37 // CHECK-SAME: <4 x i1> noundef [[X:%.*]], <4 x i1> noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR0]] {
38 // CHECK-NEXT: [[ENTRY:.*:]]
39 // CHECK-NEXT: [[HLSL_AND:%.*]] = and <4 x i1> [[X]], [[Y]]
40 // CHECK-NEXT: ret <4 x i1> [[HLSL_AND]]
41 //
42 bool4 test_and_bool4(bool4 x, bool4 y) {
43 return and(x, y);
44 }
45
46 // CHECK-LABEL: define hidden noundef <4 x i1> @_Z13test_and_int4Dv4_iS_(
47 // CHECK-SAME: <4 x i32> noundef [[X:%.*]], <4 x i32> noundef [[Y:%.*]]) local_unnamed_addr #[[ATTR0]] {
48 // CHECK-NEXT: [[ENTRY:.*:]]
49 // CHECK-NEXT: [[TOBOOL:%.*]] = icmp ne <4 x i32> [[X]], zeroinitializer
50 // CHECK-NEXT: [[TOBOOL1:%.*]] = icmp ne <4 x i32> [[Y]], zeroinitializer
51 // CHECK-NEXT: [[HLSL_AND:%.*]] = and <4 x i1> [[TOBOOL]], [[TOBOOL1]]
52 // CHECK-NEXT: ret <4 x i1> [[HLSL_AND]]
53 //
54 bool4 test_and_int4(int4 x, int4 y) {
55 return and(x, y);
56 }
57
58 // CHECK-LABEL: define hidden noundef <4 x i1> @_Z15test_and_float4Dv4_fS_(
59 // CHECK-SAME: <4 x float> noundef nofpclass(nan inf) [[X:%.*]], <4 x float> noundef nofpclass(nan inf) [[Y:%.*]]) local_unnamed_addr #[[ATTR0]] {
60 // CHECK-NEXT: [[ENTRY:.*:]]
61 // CHECK-NEXT: [[TOBOOL:%.*]] = fcmp reassoc nnan ninf nsz arcp afn une <4 x float> [[X]], zeroinitializer
62 // CHECK-NEXT: [[TOBOOL1:%.*]] = fcmp reassoc nnan ninf nsz arcp afn une <4 x float> [[Y]], zeroinitializer
63 // CHECK-NEXT: [[HLSL_AND:%.*]] = and <4 x i1> [[TOBOOL]], [[TOBOOL1]]
64 // CHECK-NEXT: ret <4 x i1> [[HLSL_AND]]
65 //
66 bool4 test_and_float4(float4 x, float4 y) {
67 return and(x, y);
68 }