From ae85bb8ceb625ab8a655124da96e8941daf8bd2a Mon Sep 17 00:00:00 2001 From: Xiang Li Date: Wed, 1 Nov 2023 14:04:50 -0400 Subject: [PATCH] [lit] convert verify test as lit FileCheck test part1.5 (#5912) Add non-lib profile RUN line when possible. --- .../test/SemaHLSL/array-index-out-of-bounds-HV-2016.hlsl | 5 +++-- tools/clang/test/SemaHLSL/array-index-out-of-bounds.hlsl | 4 +++- tools/clang/test/SemaHLSL/array-length.hlsl | 3 +++ tools/clang/test/SemaHLSL/atomic-float-errors.hlsl | 2 ++ tools/clang/test/SemaHLSL/attributes.hlsl | 2 ++ tools/clang/test/SemaHLSL/builtin-types-no-inheritance.hlsl | 2 ++ tools/clang/test/SemaHLSL/const-assign.hlsl | 2 ++ tools/clang/test/SemaHLSL/const-default.hlsl | 2 ++ tools/clang/test/SemaHLSL/const-expr.hlsl | 4 +++- .../SemaHLSL/conversions-between-type-shapes-strictudt.hlsl | 2 ++ .../clang/test/SemaHLSL/conversions-between-type-shapes.hlsl | 2 ++ .../test/SemaHLSL/conversions-non-numeric-aggregates.hlsl | 2 ++ tools/clang/test/SemaHLSL/enums.hlsl | 2 ++ tools/clang/test/SemaHLSL/functions.hlsl | 4 +++- tools/clang/test/SemaHLSL/intrinsic-examples.hlsl | 2 ++ tools/clang/test/SemaHLSL/invalid-decl-template-arg.hlsl | 2 ++ tools/clang/test/SemaHLSL/matrix-assignments.hlsl | 2 ++ tools/clang/test/SemaHLSL/matrix-syntax-exact-precision.hlsl | 3 ++- tools/clang/test/SemaHLSL/matrix-syntax.hlsl | 3 ++- tools/clang/test/SemaHLSL/more-operators.hlsl | 4 +++- tools/clang/test/SemaHLSL/overloading-new-delete-errors.hlsl | 2 ++ tools/clang/test/SemaHLSL/packreg.hlsl | 2 ++ .../test/SemaHLSL/scalar-assignments-exact-precision.hlsl | 2 ++ tools/clang/test/SemaHLSL/scalar-assignments.hlsl | 2 ++ tools/clang/test/SemaHLSL/sizeof.hlsl | 2 ++ tools/clang/test/SemaHLSL/string.hlsl | 2 ++ tools/clang/test/SemaHLSL/struct-assignments.hlsl | 2 ++ tools/clang/test/SemaHLSL/subobjects-syntax.hlsl | 2 ++ .../test/SemaHLSL/template-literal-substitution-failure.hlsl | 3 +++ .../test/SemaHLSL/use-undefined-overloaded-operator.hlsl | 2 ++ tools/clang/test/SemaHLSL/vector-assignments.hlsl | 2 ++ 31 files changed, 69 insertions(+), 8 deletions(-) diff --git a/tools/clang/test/SemaHLSL/array-index-out-of-bounds-HV-2016.hlsl b/tools/clang/test/SemaHLSL/array-index-out-of-bounds-HV-2016.hlsl index ebae2f22f4..21ec2166b2 100644 --- a/tools/clang/test/SemaHLSL/array-index-out-of-bounds-HV-2016.hlsl +++ b/tools/clang/test/SemaHLSL/array-index-out-of-bounds-HV-2016.hlsl @@ -1,4 +1,5 @@ -// RUN: %dxc -Tlib_6_3 -Wno-unused-value -HV 2016 -verify %s +// RUN: %dxc -Tlib_6_3 -Wno-unused-value -HV 2016 -verify %s +// RUN: %dxc -Tvs_6_0 -Wno-unused-value -HV 2016 -verify %s void dead() { @@ -10,5 +11,5 @@ void dead() array[1] = 0; array[2] = 0; /* expected-warning {{array index 2 is past the end of the array (which contains 2 elements)}} fxc-pass {{}} */ } - +[shader("vertex")] void main() {} diff --git a/tools/clang/test/SemaHLSL/array-index-out-of-bounds.hlsl b/tools/clang/test/SemaHLSL/array-index-out-of-bounds.hlsl index 89ca8a1eca..3ca50b2488 100644 --- a/tools/clang/test/SemaHLSL/array-index-out-of-bounds.hlsl +++ b/tools/clang/test/SemaHLSL/array-index-out-of-bounds.hlsl @@ -1,5 +1,7 @@ -// RUN: %dxc -Tlib_6_3 -Wno-unused-value -verify %s +// RUN: %dxc -Tlib_6_3 -Wno-unused-value -verify %s +// RUN: %dxc -Tvs_6_0 -Wno-unused-value -verify %s +[shader("vertex")] void main() { // expected-note@+2 {{array 'array' declared here}} diff --git a/tools/clang/test/SemaHLSL/array-length.hlsl b/tools/clang/test/SemaHLSL/array-length.hlsl index cb87572ae5..1541bd5de5 100644 --- a/tools/clang/test/SemaHLSL/array-length.hlsl +++ b/tools/clang/test/SemaHLSL/array-length.hlsl @@ -1,4 +1,6 @@ // RUN: %dxc -Tlib_6_3 -verify -HV 2016 %s +// RUN: %dxc -Tps_6_0 -verify -HV 2016 %s + // :FXC_VERIFY_ARGUMENTS: /T ps_5_0 /E main float4 planes1[8]; @@ -8,6 +10,7 @@ struct S { float4 planes[2]; }; +[shader("pixel")] [RootSignature("CBV(b0, space=0, visibility=SHADER_VISIBILITY_ALL)")] float main(S s:POSITION) : SV_Target { float4 planes3[] = {{ 1.0, 2.0, 3.0, 4.0 }}; diff --git a/tools/clang/test/SemaHLSL/atomic-float-errors.hlsl b/tools/clang/test/SemaHLSL/atomic-float-errors.hlsl index fb6d77b432..f73188f653 100644 --- a/tools/clang/test/SemaHLSL/atomic-float-errors.hlsl +++ b/tools/clang/test/SemaHLSL/atomic-float-errors.hlsl @@ -1,4 +1,5 @@ // RUN: %dxc -Tlib_6_3 -verify %s +// RUN: %dxc -Tcs_6_0 -verify %s // Verify that the first arg determines the overload and the others can be what they will @@ -9,6 +10,7 @@ RWBuffer resBI64; RWByteAddressBuffer Rres; +[shader("compute")] [numthreads(1,1,1)] void main( uint3 gtid : SV_GroupThreadID) { diff --git a/tools/clang/test/SemaHLSL/attributes.hlsl b/tools/clang/test/SemaHLSL/attributes.hlsl index aa256b47da..25b1ea174b 100644 --- a/tools/clang/test/SemaHLSL/attributes.hlsl +++ b/tools/clang/test/SemaHLSL/attributes.hlsl @@ -1,4 +1,5 @@ // RUN: %dxc -Tlib_6_3 -HV 2018 -verify %s +// RUN: %dxc -Tps_6_0 -HV 2018 -verify %s // To test with the classic compiler, run // %sdxroot%\tools\x86\fxc.exe /T ps_5_1 attributes.hlsl @@ -696,6 +697,7 @@ void uniform_maxvertexcount2(triangle GSVertex v[3], inout TriangleStream diff --git a/tools/clang/test/SemaHLSL/builtin-types-no-inheritance.hlsl b/tools/clang/test/SemaHLSL/builtin-types-no-inheritance.hlsl index 9a8ee02f14..ec03526494 100644 --- a/tools/clang/test/SemaHLSL/builtin-types-no-inheritance.hlsl +++ b/tools/clang/test/SemaHLSL/builtin-types-no-inheritance.hlsl @@ -1,4 +1,5 @@ // RUN: %dxc -Tlib_6_3 -Wno-unused-value -verify %s +// RUN: %dxc -Tvs_6_0 -Wno-unused-value -verify %s // expected-note@? {{'vector' declared here}} // expected-note@? {{'matrix' declared here}} @@ -31,4 +32,5 @@ struct BITIA : BuiltInTriangleIntersectionAttributes {}; // expected-error {{bas struct RTAS : RaytracingAccelerationStructure {}; // expected-error {{base 'RaytracingAccelerationStructure' is marked 'final'}} fxc-error {{X3000: syntax error: unexpected token 'RaytracingAccelerationStructure'}} struct GRS : GlobalRootSignature {}; // expected-error {{base 'GlobalRootSignature' is marked 'final'}} fxc-error {{X3000: syntax error: unexpected token 'GlobalRootSignature'}} +[shader("vertex")] void main() {} diff --git a/tools/clang/test/SemaHLSL/const-assign.hlsl b/tools/clang/test/SemaHLSL/const-assign.hlsl index e7977b2355..70fea36274 100644 --- a/tools/clang/test/SemaHLSL/const-assign.hlsl +++ b/tools/clang/test/SemaHLSL/const-assign.hlsl @@ -1,5 +1,7 @@ // RUN: %dxc -Tlib_6_3 -Wno-unused-value -verify %s +// RUN: %dxc -Tps_6_0 -Wno-unused-value -verify %s +[shader("pixel")] float4 main() : SV_TARGET { const float c = 2.0; // expected-note {{variable 'c' declared const here}} expected-note {{variable 'c' declared const here}} fxc-pass {{}} diff --git a/tools/clang/test/SemaHLSL/const-default.hlsl b/tools/clang/test/SemaHLSL/const-default.hlsl index 77365ad014..2ebb6fe52e 100644 --- a/tools/clang/test/SemaHLSL/const-default.hlsl +++ b/tools/clang/test/SemaHLSL/const-default.hlsl @@ -1,4 +1,5 @@ // RUN: %dxc -Tlib_6_3 -Wno-unused-value -verify %s +// RUN: %dxc -Tps_6_0 -Wno-unused-value -verify %s float g_float1; /* expected-note {{variable 'g_float1' declared const here}} expected-note {{variable 'g_float1' declared const here}} fxc-pass {{}} */ int4 g_vec1; /* expected-note {{variable 'g_vec1' declared const here}} expected-note {{variable 'g_vec1' declared const here}} fxc-pass {{}} */ @@ -41,6 +42,7 @@ TextureBuffer g_texture_buffer3; /* expected-error {{ ConstantBuffer g_const_buffer4; /* expected-error {{variable has incomplete type 'FWDDeclClass'}} */ TextureBuffer g_texture_buffer4; /* expected-error {{variable has incomplete type 'FWDDeclClass'}} */ +[shader("pixel")] float4 main() : SV_TARGET { g_float1 = g_float1 + 10.0; /* expected-error {{cannot assign to variable 'g_float1' with const-qualified type 'const float'}} fxc-error {{X3025: global variables are implicitly constant, enable compatibility mode to allow modification}} */ diff --git a/tools/clang/test/SemaHLSL/const-expr.hlsl b/tools/clang/test/SemaHLSL/const-expr.hlsl index 82b0fb9e43..6141189fbf 100644 --- a/tools/clang/test/SemaHLSL/const-expr.hlsl +++ b/tools/clang/test/SemaHLSL/const-expr.hlsl @@ -1,4 +1,5 @@ // RUN: %dxc -Tlib_6_3 -Wno-unused-value -verify %s +// RUN: %dxc -Tvs_6_0 -Wno-unused-value -verify %s float overload1(float f) { return 1; } /* expected-note {{candidate function}} expected-note {{candidate function}} expected-note {{candidate function}} expected-note {{candidate function}} expected-note {{candidate function}} fxc-pass {{}} */ double overload1(double f) { return 2; } /* expected-note {{candidate function}} expected-note {{candidate function}} expected-note {{candidate function}} expected-note {{candidate function}} expected-note {{candidate function}} fxc-pass {{}} */ @@ -381,5 +382,6 @@ void fn_ice() { float arr_vc_Two[vc_Two.x]; /* expected-error {{variable length arrays are not supported in HLSL}} fxc-pass {{}} */ } -void cs_main() { +[shader("vertex")] +void main() { } diff --git a/tools/clang/test/SemaHLSL/conversions-between-type-shapes-strictudt.hlsl b/tools/clang/test/SemaHLSL/conversions-between-type-shapes-strictudt.hlsl index 1b9cd9825a..648960cec6 100644 --- a/tools/clang/test/SemaHLSL/conversions-between-type-shapes-strictudt.hlsl +++ b/tools/clang/test/SemaHLSL/conversions-between-type-shapes-strictudt.hlsl @@ -1,4 +1,5 @@ // RUN: %dxc -Tlib_6_3 -HV 2021 -Wno-unused-value -verify %s +// RUN: %dxc -Tvs_6_0 -HV 2021 -Wno-unused-value -verify %s // Tests all implicit conversions and explicit casts between type shapes // (scalars, vectors, matrices, arrays and structs). @@ -122,6 +123,7 @@ void to_s2(S2 s) {} void to_s4(S4 s) {} void to_s5(S5 s) {} +[shader("vertex")] void main() { int i = 0; diff --git a/tools/clang/test/SemaHLSL/conversions-between-type-shapes.hlsl b/tools/clang/test/SemaHLSL/conversions-between-type-shapes.hlsl index 985edd2a3f..a1aec6d086 100644 --- a/tools/clang/test/SemaHLSL/conversions-between-type-shapes.hlsl +++ b/tools/clang/test/SemaHLSL/conversions-between-type-shapes.hlsl @@ -1,4 +1,5 @@ // RUN: %dxc -Tlib_6_3 -Wno-unused-value -verify -HV 2018 %s +// RUN: %dxc -Tvs_6_0 -Wno-unused-value -verify -HV 2018 %s // Tests all implicit conversions and explicit casts between type shapes // (scalars, vectors, matrices, arrays and structs). @@ -108,6 +109,7 @@ void to_s2(S2 s) {} void to_s4(S4 s) {} void to_s5(S5 s) {} +[shader("vertex")] void main() { int i = 0; diff --git a/tools/clang/test/SemaHLSL/conversions-non-numeric-aggregates.hlsl b/tools/clang/test/SemaHLSL/conversions-non-numeric-aggregates.hlsl index d72fdc8590..df47f2ca5f 100644 --- a/tools/clang/test/SemaHLSL/conversions-non-numeric-aggregates.hlsl +++ b/tools/clang/test/SemaHLSL/conversions-non-numeric-aggregates.hlsl @@ -1,10 +1,12 @@ // RUN: %dxc -Tlib_6_3 -Wno-unused-value -verify %s +// RUN: %dxc -Tvs_6_0 -Wno-unused-value -verify %s // Tests that conversions between numeric and non-numeric types/aggregates are disallowed. struct NumStruct { int a; }; struct ObjStruct { Buffer a; }; +[shader("vertex")] void main() { (Buffer[1])0; /* expected-error {{cannot convert from 'literal int' to 'Buffer [1]'}} fxc-error {{X3017: cannot convert from 'int' to 'Buffer[1]'}} */ diff --git a/tools/clang/test/SemaHLSL/enums.hlsl b/tools/clang/test/SemaHLSL/enums.hlsl index c607703310..cffdbe49c8 100644 --- a/tools/clang/test/SemaHLSL/enums.hlsl +++ b/tools/clang/test/SemaHLSL/enums.hlsl @@ -1,4 +1,5 @@ // RUN: %dxc -Tlib_6_3 -HV 2017 -verify %s +// RUN: %dxc -Tps_6_0 -HV 2017 -verify %s enum MyEnum { ZERO, @@ -121,6 +122,7 @@ int getValueFromInt(int i) { /* expected-note {{c } } +[shader("pixel")] int4 main() : SV_Target { int v0 = getValueFromInt(ZERO); int v1 = getValueFromInt(MyEnumClass::ONEC); /* expected-error {{no matching function for call to 'getValueFromInt'}} */ diff --git a/tools/clang/test/SemaHLSL/functions.hlsl b/tools/clang/test/SemaHLSL/functions.hlsl index c7f7a4546b..1331d91d32 100644 --- a/tools/clang/test/SemaHLSL/functions.hlsl +++ b/tools/clang/test/SemaHLSL/functions.hlsl @@ -1,4 +1,5 @@ // RUN: %dxc -Tlib_6_3 -Wno-unused-value -HV 2018 -verify %s +// RUN: %dxc -Tvs_6_0 -Wno-unused-value -HV 2018 -verify %s // __decltype is the GCC way of saying 'decltype', but doesn't require C++11 // _Static_assert is the C11 way of saying 'static_assert', but doesn't require C++11 @@ -263,7 +264,8 @@ void inout_calls() { fn_uint_oload3(f2.x); // this selects the in version over inout or out } -void cs_main() { +[shader("vertex")] +void main() { float2 f2 = float2(1, 2); float arr2[2] = { 1, 2 }; fn_float_arr(f2); // expected-error {{no matching function for call to 'fn_float_arr'}} fxc-error {{X3017: 'fn_float_arr': cannot convert from 'float2' to 'float[2]'}} diff --git a/tools/clang/test/SemaHLSL/intrinsic-examples.hlsl b/tools/clang/test/SemaHLSL/intrinsic-examples.hlsl index db55b7c652..5feb31e5a1 100644 --- a/tools/clang/test/SemaHLSL/intrinsic-examples.hlsl +++ b/tools/clang/test/SemaHLSL/intrinsic-examples.hlsl @@ -11,6 +11,7 @@ float4 FetchFromIndexMap( uniform Texture2D Tex, uniform SamplerState SS, const struct S { float f; }; RWByteAddressBuffer uav1 : register(u3); +[shader("pixel")] float4 RWByteAddressBufferMain(uint2 a : A, uint2 b : B) : SV_Target { float4 r = 0; @@ -97,6 +98,7 @@ uint64_t4 g_u64; // TODO: currently compiler is not handling intrinsics correctly after we found overloaded intrinsic function before. // Uncomment errors below after fixing it. +[shader("pixel")] float4 BitCastMain() : SV_Target { float4 f1 = 0; f1 += asfloat(g_f); diff --git a/tools/clang/test/SemaHLSL/invalid-decl-template-arg.hlsl b/tools/clang/test/SemaHLSL/invalid-decl-template-arg.hlsl index 88fc9113bb..fabd9e33ed 100644 --- a/tools/clang/test/SemaHLSL/invalid-decl-template-arg.hlsl +++ b/tools/clang/test/SemaHLSL/invalid-decl-template-arg.hlsl @@ -1,4 +1,5 @@ // RUN: %dxc -Tlib_6_3 -verify %s +// RUN: %dxc -Tvs_6_0 -verify %s struct FOOO_A_B { // expected-note{{'FOOO_A_B' declared here}} expected-note{{definition of 'FOOO_A_B' is not complete until the closing '}'}} FOOO_A v0; // expected-error{{unknown type name 'FOOO_A'; did you mean 'FOOO_A_B'}} expected-error{{field has incomplete type 'FOOO_A_B}} @@ -6,4 +7,5 @@ struct FOOO_A_B { // expected-note{{'FOOO_A_B' declared here}} expected-note{{de RWStructuredBuffer Input; +[shader("vertex")] void main() {} diff --git a/tools/clang/test/SemaHLSL/matrix-assignments.hlsl b/tools/clang/test/SemaHLSL/matrix-assignments.hlsl index 4d12dbf663..0584ed5c26 100644 --- a/tools/clang/test/SemaHLSL/matrix-assignments.hlsl +++ b/tools/clang/test/SemaHLSL/matrix-assignments.hlsl @@ -1,4 +1,5 @@ // RUN: %dxc -Tlib_6_3 -verify %s +// RUN: %dxc -Tps_6_0 -verify %s // To test with the classic compiler, run // %sdxroot%\tools\x86\fxc.exe /T vs_2_0 matrix-assignments.hlsl @@ -35,6 +36,7 @@ void fn3(inout float3 val) val.y += 2; } +[shader("pixel")] float4 main() : SV_Target { float2 f2; diff --git a/tools/clang/test/SemaHLSL/matrix-syntax-exact-precision.hlsl b/tools/clang/test/SemaHLSL/matrix-syntax-exact-precision.hlsl index d55cbf1d7b..4186d31852 100644 --- a/tools/clang/test/SemaHLSL/matrix-syntax-exact-precision.hlsl +++ b/tools/clang/test/SemaHLSL/matrix-syntax-exact-precision.hlsl @@ -1,5 +1,5 @@ // RUN: %dxc -Tlib_6_3 -enable-16bit-types -verify -HV 2018 %s - +// RUN: %dxc -Tvs_6_2 -enable-16bit-types -verify -HV 2018 %s // To test with the classic compiler, run // %sdxroot%\tools\x86\fxc.exe /T vs_5_1 matrix-syntax.hlsl @@ -80,6 +80,7 @@ void matrix_unsigned() { unsigned int64_t1x4 uint64_tMatrix1; /* fxc-error {{X3000: syntax error: unexpected token 'int64_t1x4'}} */ } +[shader("vertex")] void main() { // Multiple assignments in a chain. matrix mymatrix; diff --git a/tools/clang/test/SemaHLSL/matrix-syntax.hlsl b/tools/clang/test/SemaHLSL/matrix-syntax.hlsl index 95329f13d2..48ec0fa7f9 100644 --- a/tools/clang/test/SemaHLSL/matrix-syntax.hlsl +++ b/tools/clang/test/SemaHLSL/matrix-syntax.hlsl @@ -1,5 +1,5 @@ // RUN: %dxc -Tlib_6_3 -verify %s - +// RUN: %dxc -Tvs_6_0 -verify %s // To test with the classic compiler, run // %sdxroot%\tools\x86\fxc.exe /T vs_5_1 matrix-syntax.hlsl @@ -77,6 +77,7 @@ void matrix_unsigned() { } +[shader("vertex")] void main() { // Multiple assignments in a chain. matrix mymatrix; diff --git a/tools/clang/test/SemaHLSL/more-operators.hlsl b/tools/clang/test/SemaHLSL/more-operators.hlsl index 55924f6b68..cbd0250fb9 100644 --- a/tools/clang/test/SemaHLSL/more-operators.hlsl +++ b/tools/clang/test/SemaHLSL/more-operators.hlsl @@ -1,4 +1,5 @@ // RUN: %dxc -Tlib_6_3 -Wno-unused-value -verify %s +// RUN: %dxc -Tps_6_0 -Wno-unused-value -verify %s // This file includes operator tests that target specific cases that are not // otherwise covered by the other generated files. @@ -491,7 +492,8 @@ float3 fn(float a, float b) return bar < 1 ? float3(foo) : bar; // expected-error {{use of undeclared identifier 'foo'}} fxc-error {{X3004: undeclared identifier 'bar'}} } -float4 main2(float2 coord : TEXCOORD) : SV_Target +[shader("pixel")] +float4 main(float2 coord : TEXCOORD) : SV_Target { return DoSample(tex12, fn(coord.x, coord.y).xy); } diff --git a/tools/clang/test/SemaHLSL/overloading-new-delete-errors.hlsl b/tools/clang/test/SemaHLSL/overloading-new-delete-errors.hlsl index 820388fbf0..ed68ecc4d9 100644 --- a/tools/clang/test/SemaHLSL/overloading-new-delete-errors.hlsl +++ b/tools/clang/test/SemaHLSL/overloading-new-delete-errors.hlsl @@ -1,4 +1,5 @@ // RUN: %dxc -Tlib_6_3 -Wno-unused-value -verify -HV 2021 %s +// RUN: %dxc -Tvs_6_0 -Wno-unused-value -verify -HV 2021 %s // This test checks that when we overload new or delete operator // dxcompiler generates error and no crashes are observed. @@ -14,6 +15,7 @@ struct S } }; +[shader("vertex")] void main() { S *a = new S(); // expected-error {{'new' is a reserved keyword in HLSL}} expected-error {{pointers are unsupported in HLSL}} delete a; // expected-error {{'delete' is a reserved keyword in HLSL}} diff --git a/tools/clang/test/SemaHLSL/packreg.hlsl b/tools/clang/test/SemaHLSL/packreg.hlsl index 309f0e0dbb..47af00c279 100644 --- a/tools/clang/test/SemaHLSL/packreg.hlsl +++ b/tools/clang/test/SemaHLSL/packreg.hlsl @@ -1,4 +1,5 @@ // RUN: %dxc -Tlib_6_3 -verify %s +// RUN: %dxc -Tps_6_0 -verify %s // :FXC_VERIFY_ARGUMENTS: /E main /T ps_5_1 // fxc error X3115: Conflicting register semantics: 's0' and 's1' @@ -633,6 +634,7 @@ float2 f2() { return 0; } +[shader("pixel")] float4 main(float4 param4 : TEXCOORD0) : SV_Target0 { float f = OuterItem0 + OuterItem1 + InnerItem0; return g_txDiffuse.Sample(myVar_s, float2(1, f)); diff --git a/tools/clang/test/SemaHLSL/scalar-assignments-exact-precision.hlsl b/tools/clang/test/SemaHLSL/scalar-assignments-exact-precision.hlsl index 98991aa97c..bab5a52abf 100644 --- a/tools/clang/test/SemaHLSL/scalar-assignments-exact-precision.hlsl +++ b/tools/clang/test/SemaHLSL/scalar-assignments-exact-precision.hlsl @@ -1,9 +1,11 @@ // RUN: %dxc -Tlib_6_3 -enable-16bit-types -verify -HV 2018 %s +// RUN: %dxc -Tvs_6_2 -enable-16bit-types -verify -HV 2018 %s // To test with the classic compiler, run // %sdxroot%\tools\x86\fxc.exe /T vs_5_1 scalar-assignments.hlsl // with vs_2_0 (the default) min16float usage produces a complaint that it's not supported +[shader("vertex")] void main() { snorm snorm float ssf; // expected-warning {{attribute 'snorm' is already applied}} fxc-error {{X3000: syntax error: unexpected token 'snorm'}} diff --git a/tools/clang/test/SemaHLSL/scalar-assignments.hlsl b/tools/clang/test/SemaHLSL/scalar-assignments.hlsl index c6fd2e9d13..ecc7f2465c 100644 --- a/tools/clang/test/SemaHLSL/scalar-assignments.hlsl +++ b/tools/clang/test/SemaHLSL/scalar-assignments.hlsl @@ -1,9 +1,11 @@ // RUN: %dxc -Tlib_6_3 -verify %s +// RUN: %dxc -Tvs_6_0 -verify %s // To test with the classic compiler, run // %sdxroot%\tools\x86\fxc.exe /T vs_5_1 scalar-assignments.hlsl // with vs_2_0 (the default) min16float usage produces a complaint that it's not supported +[shader("vertex")] void main() { snorm snorm float ssf; // expected-warning {{attribute 'snorm' is already applied}} fxc-error {{X3000: syntax error: unexpected token 'snorm'}} diff --git a/tools/clang/test/SemaHLSL/sizeof.hlsl b/tools/clang/test/SemaHLSL/sizeof.hlsl index bb132d2dc8..df222ee816 100644 --- a/tools/clang/test/SemaHLSL/sizeof.hlsl +++ b/tools/clang/test/SemaHLSL/sizeof.hlsl @@ -1,4 +1,5 @@ // RUN: %dxc -Tlib_6_3 -Wno-unused-value -verify %s +// RUN: %dxc -Tvs_6_0 -Wno-unused-value -verify %s // Tests usage of the sizeof operator @@ -6,6 +7,7 @@ struct EmptyStruct {}; struct SimpleStruct { int x; }; struct StructWithResource { Buffer buf; int x; }; +[shader("vertex")] void main() { // Type vs expression argument diff --git a/tools/clang/test/SemaHLSL/string.hlsl b/tools/clang/test/SemaHLSL/string.hlsl index 70424b73ff..dc4ca5b332 100644 --- a/tools/clang/test/SemaHLSL/string.hlsl +++ b/tools/clang/test/SemaHLSL/string.hlsl @@ -1,4 +1,5 @@ // RUN: %dxc -Tlib_6_3 -Wno-unused-value -verify %s +// RUN: %dxc -Tps_6_0 -Wno-unused-value -verify %s static const string s_global1 = "my global string 1"; /*verify-ast @@ -62,6 +63,7 @@ struct test { string field; /* expected-error {{string declaration may only appear in global scope}} fxc-pass {{}} */ }; +[shader("pixel")] float4 main() : SV_Target0 { /* */ string str; /* expected-error {{string declaration may only appear in global scope}} fxc-pass {{}} */ str = s_global2; /* expected-error {{use of undeclared identifier 'str'}} fxc-pass {{}} */ diff --git a/tools/clang/test/SemaHLSL/struct-assignments.hlsl b/tools/clang/test/SemaHLSL/struct-assignments.hlsl index 26bb07d92a..4b9e7f8778 100644 --- a/tools/clang/test/SemaHLSL/struct-assignments.hlsl +++ b/tools/clang/test/SemaHLSL/struct-assignments.hlsl @@ -1,4 +1,5 @@ // RUN: %dxc -Tlib_6_3 -verify %s +// RUN: %dxc -Tvs_6_0 -verify %s // To test with the classic compiler, run // %sdxroot%\tools\x86\fxc.exe /T vs_5_1 struct-assignments.hlsl @@ -71,6 +72,7 @@ float3 c_f3::get_inc() { return f3++; } +[shader("vertex")] void main() { s_f2 zsf2_zero_cast = (s_f2)1; diff --git a/tools/clang/test/SemaHLSL/subobjects-syntax.hlsl b/tools/clang/test/SemaHLSL/subobjects-syntax.hlsl index c72acfab2a..3ac41c75fe 100644 --- a/tools/clang/test/SemaHLSL/subobjects-syntax.hlsl +++ b/tools/clang/test/SemaHLSL/subobjects-syntax.hlsl @@ -1,4 +1,5 @@ // RUN: %dxc -Tlib_6_3 -Wno-unused-value -verify %s +// RUN: %dxc -Tps_6_0 -Wno-unused-value -verify %s string globalRs = "CBV(b0)"; string localRs = "UAV(u0, visibility = SHADER_VISIBILITY_GEOMETRY)"; @@ -99,6 +100,7 @@ TriangleHitGroup trHitGt2_8 = { s1, s4 }; ProceduralPrimitiveHitGroup ppHitGt2_8 = { s1, "", s4 }; ProceduralPrimitiveHitGroup ppHitGt2_9 = { "a", "b", ""}; +[shader("pixel")] int main(int i : INDEX) : SV_Target { return 1; } diff --git a/tools/clang/test/SemaHLSL/template-literal-substitution-failure.hlsl b/tools/clang/test/SemaHLSL/template-literal-substitution-failure.hlsl index 1cb3f56697..3c412e3865 100644 --- a/tools/clang/test/SemaHLSL/template-literal-substitution-failure.hlsl +++ b/tools/clang/test/SemaHLSL/template-literal-substitution-failure.hlsl @@ -1,4 +1,6 @@ // RUN: %dxc -Tlib_6_3 -HV 2021 -verify %s +// RUN: %dxc -Tvs_6_0 -HV 2021 -verify %s + RWStructuredBuffer Output; // expected-note@+1 {{candidate template ignored: deduced conflicting types for parameter 'T' ('float' vs. 'literal float')}} @@ -6,6 +8,7 @@ template T Add(T input, T input2) { return input + input2; } +[shader("vertex")] void main() { // expected-error@+1 {{no matching function for call to 'Add'}} Output[0] = Add(Output[0], 1.0) diff --git a/tools/clang/test/SemaHLSL/use-undefined-overloaded-operator.hlsl b/tools/clang/test/SemaHLSL/use-undefined-overloaded-operator.hlsl index b4d33683cb..159781537f 100644 --- a/tools/clang/test/SemaHLSL/use-undefined-overloaded-operator.hlsl +++ b/tools/clang/test/SemaHLSL/use-undefined-overloaded-operator.hlsl @@ -1,4 +1,5 @@ // RUN: %dxc -Tlib_6_3 -Wno-unused-value -verify -HV 2021 %s +// RUN: %dxc -Tps_6_0 -Wno-unused-value -verify -HV 2021 %s // This test checks that when we use undefined overloaded operator // dxcompiler generates error and no crashes are observed. @@ -15,6 +16,7 @@ struct S2 { S1 s1; }; +[shader("pixel")] void main(float4 pos: SV_Position) { S1 s1; S2 s2; diff --git a/tools/clang/test/SemaHLSL/vector-assignments.hlsl b/tools/clang/test/SemaHLSL/vector-assignments.hlsl index f564308c61..13bdbb930d 100644 --- a/tools/clang/test/SemaHLSL/vector-assignments.hlsl +++ b/tools/clang/test/SemaHLSL/vector-assignments.hlsl @@ -1,4 +1,5 @@ // RUN: %dxc -Tlib_6_3 -verify %s +// RUN: %dxc -Tvs_6_0 -verify %s // To test with the classic compiler, run // %sdxroot%\tools\x86\fxc.exe /T vs_2_0 vector-assignments.hlsl @@ -7,6 +8,7 @@ float pick_one(float2 f2) { return f2.x; } +[shader("vertex")] void main() { // No initialization.