array-length.hlsl 696 B

1234567891011121314151617181920
  1. // RUN: %clang_cc1 -fsyntax-only -ffreestanding -verify -HV 2016 %s
  2. float4 planes1[8];
  3. float4 planes2[3+2];
  4. struct S {
  5. float4 planes[2];
  6. };
  7. [RootSignature("CBV(b0, space=0, visibility=SHADER_VISIBILITY_ALL)")]
  8. float main(S s:POSITION) : SV_Target {
  9. float4 planes3[] = {{ 1.0, 2.0, 3.0, 4.0 }};
  10. int total = planes1.Length; // expected-warning {{Length is deprecated}} fxc-pass {{}}
  11. total += planes2.Length; // expected-warning {{Length is deprecated}} fxc-pass {{}}
  12. total += planes3.Length; // expected-warning {{Length is deprecated}} fxc-pass {{}}
  13. total += s.planes.Length; // expected-warning {{Length is deprecated}} fxc-pass {{}}
  14. return total;
  15. }