brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.1 KiB · be9a96c Raw
25 lines · plain
1// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-compute -x hlsl -emit-llvm -disable-llvm-passes -o - -hlsl-entry main %s | FileCheck %s --check-prefixes=CHECK,CHECK-DXIL -DTARGET=dx2// RUN: %clang_cc1 -triple spirv-unknown-vulkan-compute -x hlsl -emit-llvm -disable-llvm-passes -o - -hlsl-entry main %s | FileCheck %s --check-prefixes=CHECK,CHECK-SPIRV -DTARGET=spv3 4[numthreads(1,1,1)]5void main(unsigned GI : SV_GroupIndex) {6  main(GI - 1);7}8 9// For HLSL entry functions, we are generating a C-export function that wraps10// the C++-mangled entry function. The wrapper function can be used to populate11// semantic parameters and provides the expected void(void) signature that12// drivers expect for entry points.13 14// CHECK: define void @main() #[[#ENTRY_ATTR:]] {15// CHECK: entry:16// CHECK:   %[[#ID_X:]] = call i32 @llvm.[[TARGET]].flattened.thread.id.in.group()17// CHECK-DXIL:   call void @_Z4mainj(i32 %[[#ID_X]])18// CHECK-SPIRV:   call spir_func void @_Z4mainj(i32 %[[#ID_X]])19// CHECK:   ret void20// CHECK: }21 22// Verify that the entry had the expected dx.shader attribute23 24// CHECK: attributes #[[#ENTRY_ATTR]] = { {{.*}}"hlsl.shader"="compute"{{.*}} }25