1 // RUN: %clang_cc1 -std=hlsl2021 -finclude-default-header -x hlsl -triple \
2 // RUN: spirv-pc-vulkan-library %s -emit-llvm -disable-llvm-passes -o - | FileCheck %s \
3 // RUN: --check-prefixes=CHECK,CHECK-SPIRV
4 // RUN: %clang_cc1 -finclude-default-header \
5 // RUN: -triple dxil-pc-shadermodel6.3-library %s \
6 // RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s \
7 // RUN: --check-prefixes=CHECK,CHECK-DXIL
9 // CHECK-SPIRV: define spir_func noundef i32 @{{.*test_1.*}}() [[A0:#[0-9]+]] {
10 // CHECK-DXIL: define noundef i32 @{{.*test_1.*}}() [[A0:#[0-9]+]] {
11 // CHECK-SPIRV: %[[CI:[0-9]+]] = call token @llvm.experimental.convergence.entry()
12 // CHECK-SPIRV: call spir_func i32 @__hlsl_wave_get_lane_index() [ "convergencectrl"(token %[[CI]]) ]
13 // CHECK-DXIL: call i32 @llvm.dx.wave.getlaneindex()
15 return WaveGetLaneIndex();
18 // CHECK-SPIRV: declare spir_func i32 @__hlsl_wave_get_lane_index() [[A1:#[0-9]+]]
19 // CHECK-DXIL: declare i32 @llvm.dx.wave.getlaneindex() [[A1:#[0-9]+]]
21 // CHECK-DAG: attributes [[A0]] = { {{.*}}convergent{{.*}} }
22 // CHECK-DAG: attributes [[A1]] = { {{.*}}convergent{{.*}} }