Skip to content

Commit 1fe4ecf

Browse files
committed
Fix uint64_t and builtin tests
1 parent 38f2781 commit 1fe4ecf

File tree

3 files changed

+6
-15
lines changed

3 files changed

+6
-15
lines changed

clang/lib/CodeGen/CGHLSLBuiltins.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -788,7 +788,7 @@ Value *CodeGenFunction::EmitHLSLBuiltinExpr(unsigned BuiltinID,
788788
}
789789
case Builtin::BI__builtin_hlsl_wave_active_bit_or: {
790790
Value *Op = EmitScalarExpr(E->getArg(0));
791-
assert(Op->getType()->hasUnsignedIntegerRepresentation() &&
791+
assert(E->getArg(0)->getType()->hasUnsignedIntegerRepresentation() &&
792792
"Intrinsic WaveActiveBitOr operand must have a unsigned integer representation");
793793

794794
Intrinsic::ID ID = CGM.getHLSLRuntime().getWaveActiveBitOrIntrinsic();

clang/test/CodeGenHLSL/builtins/WaveActiveBitOr.hlsl

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,3 @@ uint test_uint(uint expr) {
2020
}
2121

2222
// CHECK: declare [[TY]] @llvm.[[ICF]].wave.reduce.or.i32([[TY]]) #[[#attr:]]
23-
24-
// CHECK-LABEL: test_uint64_t
25-
uint64_t test_uint64_t(uint64_t expr) {
26-
// CHECK: %[[RET:.*]] = call i1 [[TY:.*]] @llvm.[[ICF]].wave.reduce.or.i64([[TY]] %[[#]])
27-
// CHECK: ret [[TY]] %[[RET]]
28-
return WaveActiveBitOr(expr);
29-
}
30-
31-
// CHECK: declare [[TY]] @llvm.[[ICF]].wave.reduce.or.i64([[TY]]) #[[#attr:]]

clang/test/SemaHLSL/BuiltIns/WaveActiveBitOr-errors.hlsl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,29 +10,29 @@ uint2 test_too_many_arg(uint2 p0) {
1010
// expected-error@-1 {{too many arguments to function call, expected 1, have 2}}
1111
}
1212

13-
bool test_expr_bool_type_check(bool p0) {
13+
uint test_expr_bool_type_check(bool p0) {
1414
return __builtin_hlsl_wave_active_bit_or(p0);
1515
// expected-error@-1 {{invalid operand of type 'bool'}}
1616
}
1717

18-
float test_expr_float_type_check(float p0) {
18+
uint test_expr_float_type_check(float p0) {
1919
return __builtin_hlsl_wave_active_bit_or(p0);
2020
// expected-error@-1 {{invalid operand of type 'float'}}
2121
}
2222

23-
bool2 test_expr_bool_vec_type_check(bool2 p0) {
23+
uint2 test_expr_bool_vec_type_check(bool2 p0) {
2424
return __builtin_hlsl_wave_active_bit_or(p0);
2525
// expected-error@-1 {{invalid operand of type 'bool2' (aka 'vector<bool, 2>')}}
2626
}
2727

28-
float2 test_expr_float_type_check(float2 p0) {
28+
uint2 test_expr_float_type_check(float2 p0) {
2929
return __builtin_hlsl_wave_active_bit_or(p0);
3030
// expected-error@-1 {{invalid operand of type 'float2' (aka 'vector<float, 2>')}}
3131
}
3232

3333
struct S { float f; };
3434

35-
S test_expr_struct_type_check(S p0) {
35+
uint test_expr_struct_type_check(S p0) {
3636
return __builtin_hlsl_wave_active_bit_or(p0);
3737
// expected-error@-1 {{invalid operand of type 'S' where a scalar or vector is required}}
3838
}

0 commit comments

Comments
 (0)