1 // RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-compute -S -emit-llvm -disable-llvm-passes %s -o - | FileCheck %s
5 __attribute__((constructor)) void call_me_first(void) {
9 __attribute__((constructor)) void then_call_me(void) {
13 __attribute__((destructor)) void call_me_last(void) {
18 void main(unsigned GI : SV_GroupIndex) {}
20 // Make sure global variable for ctors/dtors removed.
21 // CHECK-NOT:@llvm.global_ctors
22 // CHECK-NOT:@llvm.global_dtors
24 //CHECK: define void @main()
26 //CHECK-NEXT: call void @"?call_me_first@@YAXXZ"()
27 //CHECK-NEXT: call void @"?then_call_me@@YAXXZ"()
28 //CHECK-NEXT: %0 = call i32 @llvm.dx.flattened.thread.id.in.group()
29 //CHECK-NEXT: call void @"?main@@YAXI@Z"(i32 %0)
30 //CHECK-NEXT: call void @"?call_me_last@@YAXXZ"(
31 //CHECK-NEXT: ret void