CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
70 lines
2.1 KiB
HLSL
70 lines
2.1 KiB
HLSL
// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-compute -finclude-default-header -verify -Wdouble-promotion %s
|
|
// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-compute -finclude-default-header -fexperimental-new-constant-interpreter -verify -Wdouble-promotion %s
|
|
|
|
// Some helpers!
|
|
template <typename T, typename U>
|
|
struct is_same {
|
|
static const bool value = false;
|
|
};
|
|
|
|
template <typename T>
|
|
struct is_same<T, T> {
|
|
static const bool value = true;
|
|
};
|
|
|
|
template<typename T>
|
|
struct remove_addrspace {
|
|
using type = __decltype((T)0);
|
|
};
|
|
|
|
template <typename T, typename V>
|
|
using is_same_ignore_addrspace = is_same<typename remove_addrspace<T>::type, typename remove_addrspace<V>::type>;
|
|
|
|
struct SomeVals {
|
|
int2 X;
|
|
float2 Y;
|
|
double2 D;
|
|
};
|
|
|
|
static SomeVals V = {1,2,3,4,5,6};
|
|
|
|
static int2 SomeArr[] = {V}; // #SomeArr
|
|
// expected-warning@#SomeArr 2 {{implicit conversion turns floating-point number into integer: 'double' to 'int'}}
|
|
// expected-warning@#SomeArr 2 {{implicit conversion turns floating-point number into integer: 'float' to 'int'}}
|
|
|
|
_Static_assert(is_same_ignore_addrspace<__decltype(SomeArr), int2[3]>::value, "What is this even?");
|
|
|
|
static int2 VecArr[] = {
|
|
int2(0,1),
|
|
int2(2,3),
|
|
int4(4,5,6,7),
|
|
};
|
|
|
|
_Static_assert(is_same_ignore_addrspace<__decltype(VecArr), int2[4]>::value, "One vec, two vec, three vecs, FOUR!");
|
|
|
|
static int4 V4Arr[] = {
|
|
int2(0,1),
|
|
int2(2,3),
|
|
};
|
|
|
|
_Static_assert(is_same_ignore_addrspace<__decltype(V4Arr), int4[1]>::value, "One!");
|
|
|
|
static int ArrOfArr[][4] = { 1, 2, 3, 4, 5, 6, 7, 8 };
|
|
|
|
_Static_assert(is_same_ignore_addrspace<__decltype(ArrOfArr), int[2][4]>::value, "Two arrays of four!");
|
|
|
|
// expected-error@+1{{too few initializers in list for type 'int4[]' (aka 'vector<int, 4>[]') (expected 4 but found 2)}}
|
|
static int4 V4ArrTooSmall[] = {
|
|
int2(0,1),
|
|
};
|
|
|
|
// expected-error@+1{{too few initializers in list for type 'int4[]' (aka 'vector<int, 4>[]') (expected 8 but found 7)}}
|
|
static int4 V4ArrAlsoTooSmall[] = {
|
|
int2(0,1),
|
|
int2(2,3),
|
|
int3(4,5,6),
|
|
};
|
|
|
|
// expected-error@+1{{too few initializers in list for type 'int[][2]' (expected 6 but found 5)}}
|
|
static int ArrOfArrTooSmall[][2] = { 1, 2, 3, 4, 5 };
|