Skip to content

Commit 36aede0

Browse files
committed
clean up
1 parent 8dc7932 commit 36aede0

3 files changed

Lines changed: 6 additions & 24 deletions

File tree

tools/clang/test/HLSLFileCheckLit/hlsl/auto/auto-deducible-types.hlsl

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,23 @@ RWBuffer<float> output : register(u0);
1212

1313
[numthreads(1,1,1)]
1414
void main() {
15-
// AR_TOBJ_BASIC
15+
// Scalars.
1616
auto i = 5;
1717
auto f = 1.5f;
1818
auto b = true;
1919

20-
// AR_TOBJ_VECTOR: elements are always concrete scalars (a dependent vector
21-
// is classified AR_TOBJ_DEPENDENT instead), so vectors are always deducible.
20+
// Vectors.
2221
auto v = float4(1, 2, 3, 4);
2322

24-
// AR_TOBJ_MATRIX: likewise always deducible for the same reason.
23+
// Matrices.
2524
float2x2 matInit = { 1, 2, 3, 4 };
2625
auto m = matInit;
2726

28-
// AR_TOBJ_COMPOUND
27+
// User-defined structs.
2928
MyStruct s = { 1.0f, 2 };
3029
auto sCopy = s;
3130

32-
// AR_TOBJ_OBJECT: resource handles are copyable, so binding one is allowed.
31+
// Resource objects (their handles are copyable, so binding one is allowed).
3332
auto t = tex;
3433

3534
// Use every value to prevent dead-code elimination.

tools/clang/test/HLSLFileCheckLit/hlsl/auto/auto-no-subobject.hlsl

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
// RUN: %dxc -T lib_6_3 -HV 202x -verify %s
22

3-
// Subobjects are builtin object types used only to configure the DXR state
4-
// object. They have no value semantics a deduced variable could meaningfully
5-
// bind to, so 'auto' must not infer a subobject type. Each deduction below is
6-
// expected to fail with err_hlsl_auto_undeducible_type.
7-
83
GlobalRootSignature grs = {"CBV(b0)"};
94
LocalRootSignature lrs = {"UAV(u0)"};
105
StateObjectConfig soc = { STATE_OBJECT_FLAGS_ALLOW_LOCAL_DEPENDENCIES_ON_EXTERNAL_DEFINITONS };

tools/clang/test/HLSLFileCheckLit/hlsl/auto/auto-undeducible-types.hlsl

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,34 +6,22 @@ void voidFunc() {}
66
Texture2D<float4> tex : register(t0);
77
Texture2DMS<float4> texMS : register(t1);
88

9-
// 'string' is an internal type (printf formats, subobject fields); it is only
10-
// declarable as a global, and is intentionally not deducible by 'auto'.
11-
string gStr = "abc";
12-
139
[numthreads(1,1,1)]
1410
void main() {
1511
int y = 1;
1612

17-
// AR_TOBJ_STRING: 'string' is excluded from 'auto' deduction.
1813
// expected-error@+1 {{'auto' cannot deduce type}}
19-
auto str = gStr;
14+
auto str = "abc";
2015

21-
// void: a void-returning call has no value type. 'auto' deduces 'void',
22-
// which is rejected as an incomplete variable type (not by the HLSL
23-
// auto-deducibility check, which only special-cases string/inner/subobject).
2416
// expected-error@+1 {{variable has incomplete type 'void'}}
2517
auto x = voidFunc();
2618

27-
// void: an explicit cast to void is equally non-deducible.
2819
// expected-error@+1 {{variable has incomplete type 'void'}}
2920
auto v = (void)y;
3021

31-
// AR_TOBJ_INNER_OBJ: .mips is an inner indexer object (Texture2D::mips_type).
3222
// expected-error@+1 {{'auto' cannot deduce type}}
3323
auto m = tex.mips;
3424

35-
// AR_TOBJ_INNER_OBJ: .sample is an inner indexer object
36-
// (Texture2DMS::sample_type).
3725
// expected-error@+1 {{'auto' cannot deduce type}}
3826
auto s = texMS.sample;
3927
}

0 commit comments

Comments
 (0)