Skip to content

Commit a333d3b

Browse files
authored
[lit] convert verify test as lit FileCheck test part3 (microsoft#5910)
Move the verify shaders which not enabled in taef to lit. This is for microsoft#5870
1 parent e496555 commit a333d3b

File tree

4 files changed

+22
-10
lines changed

4 files changed

+22
-10
lines changed

tools/clang/test/HLSL/loop-induction-scoping-2021.hlsl renamed to tools/clang/test/SemaHLSL/loop-induction-scoping-2021.hlsl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
// RUN: %clang_cc1 -fsyntax-only -ffreestanding -verify -HV 2021 %s
1+
// RUN: %dxc -Tlib_6_3 -verify -HV 2021 %s
2+
// RUN: %dxc -Tps_6_0 -verify -HV 2021 %s
3+
4+
// expected-no-diagnostics
25

36
uint g_count1;
47
uint g_count2;

tools/clang/test/HLSL/overloading-unsupported-operators.hlsl renamed to tools/clang/test/SemaHLSL/overloading-unsupported-operators.hlsl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
// RUN: %clang_cc1 -fsyntax-only -Wno-unused-value -ffreestanding -verify -HV 2021 %s
1+
// RUN: %dxc -Tlib_6_3 -Wno-unused-value -verify -HV 2021 %s
2+
// RUN: %dxc -Tcs_6_0 -verify -HV 2021 %s
23

34
// This test checks that dxcompiler generates errors when overloading operators
45
// that are not supported for overloading in HLSL 2021
Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
// RUN: %clang_cc1 -fsyntax-only -ffreestanding -verify %s
1+
// RUN: %dxc -Tlib_6_3 -HV 2018 -verify %s
2+
// RUN: %dxc -Tps_6_0 -HV 2018 -verify %s
23

34
// This file provides test cases that are cross-references to the HLSL
45
// specification.
@@ -78,7 +79,7 @@ namespace ns_basic {
7879
//typedef int UNKA[]; // UNKA is an incomplete type ; fxc-error {{error X3072: array dimensions of type must be explicit}}
7980
// cbuffer C; // fxc-error {{error X3000: syntax error: unexpected token ';'}}
8081

81-
string s = "my string";
82+
string s = "my string"; // expected-error {{string declaration may only appear in global scope}}
8283
int int_var;
8384
uint uint_var;
8485
dword dword_var;
@@ -151,7 +152,7 @@ namespace ns_std_conversions {
151152
fn_f4(i); // vector splat
152153
fn_u4(f4); // vector element
153154
fn_f4(u4); // vector element
154-
f3 = f4; // vector truncate
155+
f3 = f4; // expected-warning {{implicit truncation of vector type}}
155156
// f4 = f3; // fxc-error {{error X3017: cannot implicitly convert from 'float3' to 'float4'}}
156157
fn_iof(f1); // inout case (float1->float - vector single element conversion; float->float1 vector splat)
157158
fn_iof1(u); // inout case (uint->float1 - vector splat; float1->uint vector single element conversion)
@@ -194,6 +195,7 @@ namespace ns_std_conversions {
194195
fn_f14(1);
195196

196197
u = f11; // matrix single element conversion
198+
// expected-warning@+1 {{implicit truncation of vector type}}
197199
u = f14; // matrix scalar truncation conversion
198200

199201
u2 = f11; // matrix single element vector conversion
@@ -202,8 +204,11 @@ namespace ns_std_conversions {
202204
//u3 = f12; // cannot convert if target has more
203205

204206
u44 = f44; // matrix element-type conversion
207+
// expected-warning@+1 {{implicit truncation of vector type}}
205208
u22 = f44; // can convert to smaller
209+
// expected-warning@+1 {{implicit truncation of vector type}}
206210
u22 = f33; // can convert to smaller
211+
// expected-warning@+1 {{implicit truncation of vector type}}
207212
f32 = f33; // can convert as long as each dimension is smaller
208213
//u44 = f22; // cannot convert to bigger
209214
}
@@ -307,14 +312,14 @@ namespace ns_std_conversions {
307312
namespace ns_overloading {
308313
// * Overloading
309314
// ** Overloadable declarations
310-
int f(int a) { return a; }
311-
int f(const int a) { return a; }
315+
int f(int a) { return a; } // expected-note {{previous definition is here}}
316+
int f(const int a) { return a; } // expected-error {{redefinition of 'f'}}
312317
int f_default_0(int a = 3);
313318
//int f_default_0(int a = 4); // error X3114: 'a': default parameters can only be provided in the first prototype
314-
int f_default(int a = 1) { return a; }
315-
int f_default(int a = 3); // TODO: after definition, declaration may provide default, and this is ignored
319+
int f_default(int a = 1) { return a; } // expected-note {{previous definition is here}}
320+
int f_default(int a = 3); // expected-error {{redefinition of default argument}}
316321
// int f_default_args(int a, int b = 0);
317-
int f_default_args(int a = 0, int b);
322+
int f_default_args(int a = 0, int b); // expected-error {{missing default argument on parameter 'b'}}
318323
int f_default_args() { return 1; }
319324
int f_default_args_equiv(int a);
320325
int f_default_args_equiv(int a = 1);

tools/clang/test/HLSL/template-diag-deferred.hlsl renamed to tools/clang/test/SemaHLSL/template-diag-deferred.hlsl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// RUN: %dxc -Tlib_6_6 -HV 2021 -verify %s
2+
13
template<typename T> void neverInstantiated(uint2 pos) {
24
globallycoherent T Val = 0.0f;
35
}
@@ -14,6 +16,7 @@ template<typename T> void doSomething2(uint2 pos) {
1416
}
1517

1618
void Fn() {
19+
// expected-note@+1{{in instantiation of function template specialization 'doSomething<float>' requested here}}
1720
doSomething<float>(uint2(0,0));
1821
doSomething2<RWTexture2D<float> >(uint2(0,0));
1922
}

0 commit comments

Comments
 (0)