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
1.3 KiB
C
49 lines
1.3 KiB
C
// RUN: %clang_cc1 -x c -triple bpf-pc-linux-gnu -dwarf-version=4 -fsyntax-only -verify %s
|
|
|
|
#define __reloc__ __attribute__((preserve_access_index))
|
|
#define __err_reloc__ __attribute__((preserve_access_index(0)))
|
|
|
|
struct t1 {
|
|
int a;
|
|
int b[4];
|
|
int c:1;
|
|
} __reloc__;
|
|
|
|
union t2 {
|
|
int a;
|
|
int b[4];
|
|
int c:1;
|
|
} __reloc__;
|
|
|
|
struct t3 {
|
|
int a;
|
|
} __err_reloc__; // expected-error {{'preserve_access_index' attribute takes no arguments}}
|
|
|
|
struct t4 {
|
|
union {
|
|
int a;
|
|
char b[5];
|
|
};
|
|
struct {
|
|
int c:1;
|
|
} __reloc__;
|
|
int d;
|
|
} __reloc__;
|
|
|
|
struct __reloc__ p;
|
|
struct __reloc__ q;
|
|
struct p {
|
|
int a;
|
|
};
|
|
|
|
int a __reloc__; // expected-error {{'preserve_access_index' attribute only applies to structs, unions, and classes}}
|
|
struct s *p __reloc__; // expected-error {{'preserve_access_index' attribute only applies to structs, unions, and classes}}
|
|
|
|
void invalid1(const int __reloc__ *arg) {} // expected-error {{'preserve_access_index' attribute only applies to structs, unions, and classes}}
|
|
void invalid2(void) { const int __reloc__ *arg; } // expected-error {{'preserve_access_index' attribute only applies to structs, unions, and classes}}
|
|
int valid3(struct t4 *arg) { return arg->a + arg->b[3] + arg->c + arg->d; }
|
|
int valid4(void *arg) {
|
|
struct local_t { int a; int b; } __reloc__;
|
|
return ((struct local_t *)arg)->b;
|
|
}
|