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
73 lines
2.8 KiB
C
73 lines
2.8 KiB
C
// RUN: %clang_analyze_cc1 -triple x86_64-pc-linux-gnu -analyzer-checker=core,optin.core.FixedAddressDereference -std=gnu99 -analyzer-config suppress-dereferences-from-any-address-space=false -verify=x86-nosuppress,common %s
|
|
// RUN: %clang_analyze_cc1 -triple x86_64-pc-linux-gnu -analyzer-checker=core,optin.core.FixedAddressDereference -std=gnu99 -verify=x86-suppress,common %s
|
|
// RUN: %clang_analyze_cc1 -triple arm-pc-linux-gnu -analyzer-checker=core,optin.core.FixedAddressDereference -std=gnu99 -analyzer-config suppress-dereferences-from-any-address-space=false -verify=other-nosuppress,common %s
|
|
// RUN: %clang_analyze_cc1 -triple arm-pc-linux-gnu -analyzer-checker=core,optin.core.FixedAddressDereference -std=gnu99 -verify=other-suppress,common %s
|
|
|
|
// Address-space attributes suppress the report even if the pointees are not marked `volatile`.
|
|
#define AS_ATTRIBUTE(_X) __attribute__((address_space(_X)))
|
|
|
|
#define _get_base() ((void * AS_ATTRIBUTE(256) *)0)
|
|
|
|
void* test_address_space_array(unsigned long slot) {
|
|
return _get_base()[slot]; // other-nosuppress-warning{{Dereference}}
|
|
}
|
|
|
|
void test_address_space_condition(int AS_ATTRIBUTE(257) *cpu_data) {
|
|
if (cpu_data == 0) {
|
|
*cpu_data = 3; // other-nosuppress-warning{{Dereference}}
|
|
}
|
|
}
|
|
|
|
struct X { int member; };
|
|
int test_address_space_member(void) {
|
|
struct X AS_ATTRIBUTE(258) *data = (struct X AS_ATTRIBUTE(258) *)0UL;
|
|
int ret;
|
|
ret = data->member; // other-nosuppress-warning{{Dereference}}
|
|
return ret;
|
|
}
|
|
|
|
void test_other_address_space_condition(int AS_ATTRIBUTE(259) *cpu_data) {
|
|
if (cpu_data == 0) {
|
|
*cpu_data = 3; // other-nosuppress-warning{{Dereference}} \
|
|
// x86-nosuppress-warning{{Dereference}}
|
|
}
|
|
}
|
|
|
|
void test_no_address_space_condition(int *cpu_data) {
|
|
if (cpu_data == 0) {
|
|
*cpu_data = 3; // common-warning{{Dereference}}
|
|
}
|
|
}
|
|
|
|
#define _fixed_get_base() ((void * AS_ATTRIBUTE(256) *)2)
|
|
|
|
void* fixed_test_address_space_array(unsigned long slot) {
|
|
return _fixed_get_base()[slot]; // other-nosuppress-warning{{Dereference}}
|
|
}
|
|
|
|
void fixed_test_address_space_condition(int AS_ATTRIBUTE(257) *cpu_data) {
|
|
if (cpu_data == (int AS_ATTRIBUTE(257) *)2) {
|
|
*cpu_data = 3; // other-nosuppress-warning{{Dereference}}
|
|
}
|
|
}
|
|
|
|
int fixed_test_address_space_member(void) {
|
|
struct X AS_ATTRIBUTE(258) *data = (struct X AS_ATTRIBUTE(258) *)2UL;
|
|
int ret;
|
|
ret = data->member; // other-nosuppress-warning{{Dereference}}
|
|
return ret;
|
|
}
|
|
|
|
void fixed_test_other_address_space_condition(int AS_ATTRIBUTE(259) *cpu_data) {
|
|
if (cpu_data == (int AS_ATTRIBUTE(259) *)2) {
|
|
*cpu_data = 3; // other-nosuppress-warning{{Dereference}} \
|
|
// x86-nosuppress-warning{{Dereference}}
|
|
}
|
|
}
|
|
|
|
void fixed_test_no_address_space_condition(int *cpu_data) {
|
|
if (cpu_data == (int *)2) {
|
|
*cpu_data = 3; // common-warning{{Dereference}}
|
|
}
|
|
}
|