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
49 lines
4.1 KiB
C++
49 lines
4.1 KiB
C++
// RUN: not %clang_cc1 -triple amdgcn-amd-amdhsa -target-cpu gfx900 -emit-llvm %s -o - 2>&1 | FileCheck %s
|
|
// RUN: not %clang_cc1 -triple spirv64-amd-amdhsa -emit-llvm %s -o - 2>&1 | FileCheck %s
|
|
|
|
bool predicate(bool x);
|
|
void pass_by_value(__amdgpu_feature_predicate_t x);
|
|
|
|
void invalid_uses(int *p, int x, const __amdgpu_feature_predicate_t &lv,
|
|
__amdgpu_feature_predicate_t &&rv) {
|
|
// CHECK: error: 'a' has type __amdgpu_feature_predicate_t, which is not constructible
|
|
__amdgpu_feature_predicate_t a;
|
|
// CHECK: error: 'b' has type __amdgpu_feature_predicate_t, which is not constructible
|
|
__amdgpu_feature_predicate_t b = __builtin_amdgcn_processor_is("gfx906");
|
|
// CHECK: error: 'c' has type __amdgpu_feature_predicate_t, which is not constructible
|
|
__amdgpu_feature_predicate_t c = lv;
|
|
// CHECK: error: 'd' has type __amdgpu_feature_predicate_t, which is not constructible
|
|
__amdgpu_feature_predicate_t d = rv;
|
|
// CHECK: error: '__builtin_amdgcn_processor_is("gfx906")' must be explicitly cast to 'bool'; however, please note that this is almost always an error and that it prevents the effective guarding of target dependent code, and thus should be avoided
|
|
bool invalid_use_in_init_0 = __builtin_amdgcn_processor_is("gfx906");
|
|
// CHECK: error: 'x' has type __amdgpu_feature_predicate_t, which is not constructible
|
|
pass_by_value(__builtin_amdgcn_processor_is("gfx906"));
|
|
// CHECK: error: '__builtin_amdgcn_is_invocable(__builtin_amdgcn_s_sleep_var)' must be explicitly cast to 'bool'; however, please note that this is almost always an error and that it prevents the effective guarding of target dependent code, and thus should be avoided
|
|
bool invalid_use_in_init_1 = __builtin_amdgcn_is_invocable(__builtin_amdgcn_s_sleep_var);
|
|
// CHECK: error: '__builtin_amdgcn_processor_is("gfx906")' must be explicitly cast to 'bool'; however, please note that this is almost always an error and that it prevents the effective guarding of target dependent code, and thus should be avoided
|
|
if (bool invalid_use_in_init_2 = __builtin_amdgcn_processor_is("gfx906")) return;
|
|
// CHECK: error: '__builtin_amdgcn_processor_is("gfx1200")' must be explicitly cast to 'bool'; however, please note that this is almost always an error and that it prevents the effective guarding of target dependent code, and thus should be avoided
|
|
if (predicate(__builtin_amdgcn_processor_is("gfx1200"))) __builtin_amdgcn_s_sleep_var(x);
|
|
}
|
|
|
|
void invalid_invocations(int x, const char* str) {
|
|
// CHECK: error: the argument to __builtin_amdgcn_processor_is must be a valid AMDGCN processor identifier; 'not_an_amdgcn_gfx_id' is not valid
|
|
// CHECK-DAG: note: valid AMDGCN processor identifiers are: {{.*}}gfx{{.*}}
|
|
if (__builtin_amdgcn_processor_is("not_an_amdgcn_gfx_id")) return;
|
|
// CHECK: error: the argument to __builtin_amdgcn_processor_is must be a string literal
|
|
if (__builtin_amdgcn_processor_is(str)) return;
|
|
// CHECK: error: the argument to __builtin_amdgcn_is_invocable must be either a target agnostic builtin or an AMDGCN target specific builtin; {{.*}}__builtin_amdgcn_s_sleep_var{{.*}} is not valid
|
|
if (__builtin_amdgcn_is_invocable("__builtin_amdgcn_s_sleep_var")) return;
|
|
// CHECK: error: the argument to __builtin_amdgcn_is_invocable must be either a target agnostic builtin or an AMDGCN target specific builtin; {{.*}}str{{.*}} is not valid
|
|
else if (__builtin_amdgcn_is_invocable(str)) return;
|
|
// CHECK: error: the argument to __builtin_amdgcn_is_invocable must be either a target agnostic builtin or an AMDGCN target specific builtin; {{.*}}x{{.*}} is not valid
|
|
else if (__builtin_amdgcn_is_invocable(x)) return;
|
|
// CHECK: error: use of undeclared identifier '__builtin_ia32_pause'
|
|
else if (__builtin_amdgcn_is_invocable(__builtin_ia32_pause)) return;
|
|
}
|
|
|
|
bool return_needs_cast() {
|
|
// CHECK: error: '__builtin_amdgcn_processor_is("gfx900")' must be explicitly cast to 'bool'; however, please note that this is almost always an error and that it prevents the effective guarding of target dependent code, and thus should be avoided
|
|
return __builtin_amdgcn_processor_is("gfx900");
|
|
}
|