Debian Codegraph @

clang/test/CodeGenHLSL/cbuf_in_namespace.hlsl

raw
1 // RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \
2 // RUN: dxil-pc-shadermodel6.3-library %s \
3 // RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s
4
5 // Make sure cbuffer inside namespace works.
6 // CHECK: @[[CB:.+]] = external constant { float }
7 // CHECK: @[[TB:.+]] = external constant { float }
8 namespace n0 {
9 namespace n1 {
10 cbuffer A {
11 float a;
12 }
13 }
14 tbuffer B {
15 float b;
16 }
17 }
18
19 float foo() {
20 // CHECK: load float, ptr @[[CB]], align 4
21 // CHECK: load float, ptr @[[TB]], align 4
22 return n0::n1::a + n0::b;
23 }