1+ // RUN: %dxc -E main -T vs_6_2 -enable-16bit-types -DLHS_TY=uint -DRHS_TY=uint %s | FileCheck %s
2+ // RUN: %dxc -E main -T vs_6_2 -enable-16bit-types -DLHS_TY=float16_t -DRHS_TY=float16_t %s | FileCheck %s
3+ // RUN: %dxc -E main -T vs_6_2 -enable-16bit-types -DLHS_TY=bool -DRHS_TY=float16_t %s | FileCheck %s
4+ // RUN: %dxc -E main -T vs_6_2 -enable-16bit-types -DLHS_TY=uint16_t -DRHS_TY=float %s | FileCheck %s
5+ // RUN: %dxc -E main -T vs_6_2 -enable-16bit-types -DLHS_TY=uint -DRHS_TY=bool %s | FileCheck %s
6+ // RUN: %dxc -E main -T vs_6_2 -enable-16bit-types -DLHS_TY=bool -DRHS_TY=uint %s | FileCheck %s
7+
8+ // This file tests truncation cast between two constexpr-vectors with different component count and/or types.
9+
10+ // CHECK: define void @main()
11+
12+
13+ RWByteAddressBuffer rwbab;
14+
15+ void main () : OUT {
16+
17+ // Case 1: all zero constant
18+ const LHS_TY s0 = vector <RHS_TY, 4 >(0 , 0 , 0 , 0 );
19+ rwbab.Store (100 , s0);
20+
21+ const vector <LHS_TY, 1 > v1 = vector <RHS_TY, 4 >(0 , 0 , 0 , 0 );
22+ rwbab.Store (200 , v1);
23+
24+ const vector <LHS_TY, 2 > v2 = vector <RHS_TY, 4 >(0 , 0 , 0 , 0 );
25+ rwbab.Store (300 , v2);
26+
27+ const vector <LHS_TY, 3 > v3 = vector <RHS_TY, 4 >(0 , 0 , 0 , 0 );
28+ rwbab.Store (400 , v3);
29+
30+ const vector <LHS_TY, 4 > v4 = vector <RHS_TY, 4 >(0 , 0 , 0 , 0 );
31+ rwbab.Store (500 , v4);
32+
33+ // Case 2: Non-zero constant
34+ const LHS_TY s1 = vector <RHS_TY, 4 >(1 , 2 , 3 , 4 );
35+ rwbab.Store (600 , s1);
36+
37+ const vector <LHS_TY, 1 > v5 = vector <RHS_TY, 4 >(1 , 2 , 3 , 4 );
38+ rwbab.Store (700 , v5);
39+
40+ const vector <LHS_TY, 2 > v6 = vector <RHS_TY, 4 >(1 , 2 , 3 , 4 );
41+ rwbab.Store (800 , v6);
42+
43+ const vector <LHS_TY, 3 > v7 = vector <RHS_TY, 4 >(1 , 2 , 3 , 4 );
44+ rwbab.Store (900 , v7);
45+
46+ const vector <LHS_TY, 4 > v8 = vector <RHS_TY, 4 >(1 , 2 , 3 , 4 );
47+ rwbab.Store (1000 , v8);
48+
49+ }
0 commit comments