| 1 |
// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl \ |
| 2 |
// RUN: -emit-pch -o %t %s |
| 3 |
// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl \ |
| 4 |
// RUN: -include-pch %t -ast-dump-all %S/Inputs/empty.hlsl \ |
| 5 |
// RUN: | FileCheck %s |
| 6 |
|
| 7 |
cbuffer A { |
| 8 |
float a; |
| 9 |
} |
| 10 |
|
| 11 |
tbuffer B { |
| 12 |
float b; |
| 13 |
} |
| 14 |
|
| 15 |
float foo() { |
| 16 |
return a + b; |
| 17 |
} |
| 18 |
// Make sure cbuffer/tbuffer works for PCH. |
| 19 |
// CHECK:HLSLBufferDecl 0x{{[0-9a-f]+}} <{{.*}}:7:1, line:9:1> line:7:9 imported <undeserialized declarations> cbuffer A |
| 20 |
// CHECK-NEXT:`-VarDecl 0x[[A:[0-9a-f]+]] <line:8:3, col:9> col:9 imported used a 'float' |
| 21 |
// CHECK-NEXT:HLSLBufferDecl 0x{{[0-9a-f]+}} <line:11:1, line:13:1> line:11:9 imported <undeserialized declarations> tbuffer B |
| 22 |
// CHECK-NEXT:`-VarDecl 0x[[B:[0-9a-f]+]] <line:12:3, col:9> col:9 imported used b 'float' |
| 23 |
// CHECK-NEXT:FunctionDecl 0x{{[0-9a-f]+}} <line:15:1, line:17:1> line:15:7 imported foo 'float ()' |
| 24 |
// CHECK-NEXT:CompoundStmt 0x{{[0-9a-f]+}} <col:13, line:17:1> |
| 25 |
// CHECK-NEXT:ReturnStmt 0x{{[0-9a-f]+}} <line:16:3, col:14> |
| 26 |
// CHECK-NEXT:BinaryOperator 0x{{[0-9a-f]+}} <col:10, col:14> 'float' '+' |
| 27 |
// CHECK-NEXT:ImplicitCastExpr 0x{{[0-9a-f]+}} <col:10> 'float' <LValueToRValue> |
| 28 |
// CHECK-NEXT:`-DeclRefExpr 0x{{[0-9a-f]+}} <col:10> 'float' lvalue Var 0x[[A]] 'a' 'float' |
| 29 |
// CHECK-NEXT:`-ImplicitCastExpr 0x{{[0-9a-f]+}} <col:14> 'float' <LValueToRValue> |
| 30 |
// CHECK-NEXT:`-DeclRefExpr 0x{{[0-9a-f]+}} <col:14> 'float' lvalue Var 0x[[B]] 'b' 'float' |