1 // RUN: %clang_cc1 -std=hlsl2021 -finclude-default-header -triple \
2 // RUN: dxil-pc-shadermodel6.3-compute %s -emit-llvm -disable-llvm-passes -o - | \
3 // RUN: FileCheck %s -DTARGET=dx
4 // RUN: %clang_cc1 -std=hlsl2021 -finclude-default-header -triple \
5 // RUN: spirv-pc-vulkan-compute %s -emit-llvm -disable-llvm-passes -o - | \
6 // RUN: FileCheck %s -DTARGET=spv
8 // Test basic lowering to runtime function call.
10 // CHECK-LABEL: test_bool
11 int test_bool(bool expr) {
12 // CHECK: call {{.*}} @llvm.[[TARGET]].wave.active.countbits
13 return WaveActiveCountBits(expr);
16 // CHECK: declare i32 @llvm.[[TARGET]].wave.active.countbits(i1) #[[#attr:]]
18 // CHECK: attributes #[[#attr]] = {{{.*}} convergent {{.*}}}