[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / CodeGenHLSL / GlobalConstructorLib.hlsl
blobe7fe4e0c4caf7de2254c3056b2c843417ec58a90
1 // RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -S -emit-llvm -disable-llvm-passes %s -o - | FileCheck %s
3 // Make sure global variable for ctors exist for lib profile.
4 // CHECK:@llvm.global_ctors
6 RWBuffer<float> Buffer;
8 [shader("compute")]
9 [numthreads(1,1,1)]
10 void FirstEntry() {}
12 // CHECK: define void @FirstEntry()
13 // CHECK-NEXT: entry:
14 // CHECK-NEXT:   call void @_GLOBAL__sub_I_GlobalConstructorLib.hlsl()
16 [shader("compute")]
17 [numthreads(1,1,1)]
18 void SecondEntry() {}
20 // CHECK: define void @SecondEntry()
21 // CHECK-NEXT: entry:
22 // CHECK-NEXT:   call void @_GLOBAL__sub_I_GlobalConstructorLib.hlsl()
23 // CHECK-NEXT:   call void @"?SecondEntry@@YAXXZ"()