1 // RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-compute -x hlsl -emit-llvm -disable-llvm-passes -o - -hlsl-entry main %s
4 void main(unsigned GI : SV_GroupIndex) {
8 // For HLSL entry functions, we are generating a C-export function that wraps
9 // the C++-mangled entry function. The wrapper function can be used to populate
10 // semantic parameters and provides the expected void(void) signature that
11 // drivers expect for entry points.
13 //CHECK: define void @main() #[[ENTRY_ATTR:#]]{
15 //CHECK-NEXT: %0 = call i32 @llvm.dx.flattened.thread.id.in.group()
16 //CHECK-NEXT: call void @"?main@@YAXI@Z"(i32 %0)
17 //CHECK-NEXT: ret void
20 // Verify that the entry had the expected dx.shader attribute
22 //CHECK: attributes #[[ENTRY_ATTR]] = { {{.*}}"dx.shader"="compute"{{.*}} }