Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / CodeGenHLSL / GlobalConstructors.hlsl
blob332302e1a8bb053e29b5d4e62ba2a24660d45502
1 // RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-compute -x hlsl -S -emit-llvm -disable-llvm-passes %s -o - | FileCheck %s
3 RWBuffer<float> Buffer;
5 [numthreads(1,1,1)]
6 void main(unsigned GI : SV_GroupIndex) {}
8 // Make sure global variable for ctors/dtors removed.
9 // CHECK-NOT:@llvm.global_ctors
10 // CHECK-NOT:@llvm.global_dtors
11 //CHECK:      define void @main()
12 //CHECK-NEXT: entry:
13 //CHECK-NEXT:   call void @_GLOBAL__sub_I_GlobalConstructors.hlsl()
14 //CHECK-NEXT:   %0 = call i32 @llvm.dx.flattened.thread.id.in.group()
15 //CHECK-NEXT:   call void @"?main@@YAXI@Z"(i32 %0)
16 //CHECK-NEXT:   ret void