File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
clang/test/SemaHLSL/Types/Traits Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -13,8 +13,21 @@ struct s {
1313 int x;
1414};
1515
16+ struct Empty {};
17+
18+ template<typename T> struct TemplatedBuffer {
19+ T a;
20+ };
21+
22+ template<typename T> struct TemplatedVector {
23+ vector <T, 4 > v;
24+ };
25+
1626// structs not allowed
1727_Static_assert (!__builtin_hlsl_is_typed_resource_element_compatible (s), "" );
28+ _Static_assert (!__builtin_hlsl_is_typed_resource_element_compatible (Empty), "" );
29+ _Static_assert (!__builtin_hlsl_is_typed_resource_element_compatible (TemplatedBuffer<int >), "" );
30+ _Static_assert (!__builtin_hlsl_is_typed_resource_element_compatible (TemplatedVector<int >), "" );
1831
1932// arrays not allowed
2033_Static_assert (!__builtin_hlsl_is_typed_resource_element_compatible (half [4 ]), "" );
@@ -23,6 +36,9 @@ typedef vector<int, 8> int8;
2336// too many elements
2437_Static_assert (!__builtin_hlsl_is_typed_resource_element_compatible (int8), "" );
2538
39+ typedef int MyInt;
40+ _Static_assert (__builtin_hlsl_is_typed_resource_element_compatible (MyInt), "" );
41+
2642// size exceeds 16 bytes, and exceeds element count limit after splitting 64 bit types into 32 bit types
2743_Static_assert (!__builtin_hlsl_is_typed_resource_element_compatible (double3 ), "" );
2844
You can’t perform that action at this time.
0 commit comments