Debian Codegraph @

clang/test/CodeGenHLSL/GlobalConstructorLib.hlsl

raw
1 // RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -emit-llvm -disable-llvm-passes %s -o - | FileCheck %s
2
3 // Make sure global variable for ctors exist for lib profile.
4 // CHECK:@llvm.global_ctors
5
6 RWBuffer<float> Buffer;
7
8 [shader("compute")]
9 [numthreads(1,1,1)]
10 void FirstEntry() {}
11
12 // CHECK: define void @FirstEntry()
13 // CHECK-NEXT: entry:
14 // CHECK-NEXT: call void @_GLOBAL__sub_I_GlobalConstructorLib.hlsl()
15
16 [shader("compute")]
17 [numthreads(1,1,1)]
18 void SecondEntry() {}
19
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"()