brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.8 KiB · 99c015e Raw
39 lines · plain
1// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -emit-pch -o %t %s2// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -include-pch %t -ast-dump-all %S/Inputs/empty.hlsl | FileCheck  %s3 4cbuffer A {5  float a;6}7 8tbuffer B {9  float b;10}11 12float foo() {13  return a + b;14}15 16// Make sure cbuffer/tbuffer works for PCH.17// CHECK: HLSLBufferDecl {{.*}} line:{{[0-9]+}}:9 imported <undeserialized declarations> cbuffer A18// CHECK-NEXT: HLSLResourceClassAttr {{.*}} Implicit CBuffer19// CHECK-NEXT: HLSLResourceBindingAttr {{.*}} Implicit "" "0"20// CHECK-NEXT: VarDecl 0x[[A:[0-9a-f]+]] {{.*}} imported used a 'hlsl_constant float'21// CHECK-NEXT: CXXRecordDecl {{.*}} imported implicit <undeserialized declarations> struct __cblayout_A definition22// CHECK: FieldDecl {{.*}} imported a 'float'23 24// CHECK: HLSLBufferDecl {{.*}} line:{{[0-9]+}}:9 imported <undeserialized declarations> tbuffer B25// CHECK-NEXT: HLSLResourceClassAttr {{.*}} Implicit SRV26// CHECK-NEXT: HLSLResourceBindingAttr {{.*}} Implicit "" "0"27// CHECK-NEXT: VarDecl 0x[[B:[0-9a-f]+]] {{.*}} imported used b 'hlsl_constant float'28// CHECK-NEXT: CXXRecordDecl 0x{{[0-9a-f]+}} {{.*}} imported implicit <undeserialized declarations> struct __cblayout_B definition29// CHECK: FieldDecl 0x{{[0-9a-f]+}} {{.*}} imported b 'float'30 31// CHECK-NEXT: FunctionDecl {{.*}} line:{{[0-9]+}}:7 imported foo 'float ()'32// CHECK-NEXT: CompoundStmt {{.*}}33// CHECK-NEXT: ReturnStmt {{.*}}34// CHECK-NEXT: BinaryOperator {{.*}} 'float' '+'35// CHECK-NEXT: ImplicitCastExpr {{.*}} 'float' <LValueToRValue>36// CHECK-NEXT: DeclRefExpr {{.*}} 'hlsl_constant float' lvalue Var 0x[[A]] 'a' 'hlsl_constant float'37// CHECK-NEXT: ImplicitCastExpr {{.*}} 'float' <LValueToRValue>38// CHECK-NEXT: DeclRefExpr {{.*}} 'hlsl_constant float' lvalue Var 0x[[B]] 'b' 'hlsl_constant float'39