Debian Codegraph @

clang/test/AST/HLSL/pch_with_buf.hlsl

raw
1 // RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -finclude-default-header -emit-pch -o %t %S/Inputs/pch_with_buf.hlsl
2 // RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -finclude-default-header -include-pch %t -ast-dump-all %s | FileCheck %s
3
4 // Make sure PCH works by using function declared in PCH header.
5 // CHECK:FunctionDecl 0x[[FOO:[0-9a-f]+]] <{{.*}}:2:1, line:4:1> line:2:8 imported used foo 'float2 (float2, float2)'
6 // Make sure buffer defined in PCH works.
7 // CHECK:VarDecl 0x{{[0-9a-f]+}} <line:6:1, col:17> col:17 imported Buf 'RWBuffer<float>'
8 // Make sure declare a RWBuffer in current file works.
9 // CHECK:VarDecl 0x{{[0-9a-f]+}} <{{.*}}:{{[0-9]+}}:1, col:23> col:23 Buf2 'hlsl::RWBuffer<float>'
10 hlsl::RWBuffer<float> Buf2;
11
12 float2 bar(float2 a, float2 b) {
13 // CHECK:CallExpr 0x{{[0-9a-f]+}} <col:10, col:18> 'float2':'vector<float, 2>'
14 // CHECK-NEXT:ImplicitCastExpr 0x{{[0-9a-f]+}} <col:10> 'float2 (*)(float2, float2)' <FunctionToPointerDecay>
15 // CHECK-NEXT:`-DeclRefExpr 0x{{[0-9a-f]+}} <col:10> 'float2 (float2, float2)' lvalue Function 0x[[FOO]] 'foo' 'float2 (float2, float2)'
16 return foo(a, b);
17 }