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
57 lines
3.4 KiB
C++
57 lines
3.4 KiB
C++
// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -std=c++23 -fsyntax-only -verify %s
|
|
|
|
// This test is testing the diagnostics that Clang emits when compiling without '+sme'.
|
|
|
|
void streaming_compatible_def() __arm_streaming_compatible {} // OK
|
|
void streaming_def() __arm_streaming { } // expected-error {{function executed in streaming-SVE mode requires 'sme'}}
|
|
void shared_za_def() __arm_inout("za") { } // expected-error {{function using ZA state requires 'sme'}}
|
|
__arm_new("za") void new_za_def() { } // expected-error {{function using ZA state requires 'sme'}}
|
|
__arm_locally_streaming void locally_streaming_def() { } // expected-error {{function executed in streaming-SVE mode requires 'sme'}}
|
|
void streaming_shared_za_def() __arm_streaming __arm_inout("za") { } // expected-error {{function executed in streaming-SVE mode requires 'sme'}}
|
|
void inout_za_def() __arm_inout("za") { } // expected-error {{function using ZA state requires 'sme'}}
|
|
void inout_zt0_def() __arm_inout("zt0") { } // expected-error {{function using ZT0 state requires 'sme2'}}
|
|
|
|
// It should work fine when we explicitly add the target("sme") attribute.
|
|
__attribute__((target("sme"))) void streaming_compatible_def_sme_attr() __arm_streaming_compatible {} // OK
|
|
__attribute__((target("sme"))) void streaming_def_sme_attr() __arm_streaming { } // OK
|
|
__attribute__((target("sme"))) void shared_za_def_sme_attr() __arm_inout("za") { } // OK
|
|
__arm_new("za") __attribute__((target("sme"))) void new_za_def_sme_attr() {} // OK
|
|
__arm_locally_streaming __attribute__((target("sme"))) void locally_streaming_def_sme_attr() {} // OK
|
|
|
|
// Test that it also works with the target("sme2") attribute.
|
|
__attribute__((target("sme2"))) void streaming_def_sme2_attr() __arm_streaming { } // OK
|
|
|
|
// No code is generated for declarations, so it should be fine to declare using the attribute.
|
|
void streaming_compatible_decl() __arm_streaming_compatible; // OK
|
|
void streaming_decl() __arm_streaming; // OK
|
|
void shared_za_decl() __arm_inout("za"); // OK
|
|
|
|
void non_streaming_decl();
|
|
void non_streaming_def(void (*streaming_fn_ptr)(void) __arm_streaming,
|
|
void (*streaming_compatible_fn_ptr)(void) __arm_streaming_compatible) {
|
|
streaming_compatible_decl(); // OK
|
|
streaming_compatible_fn_ptr(); // OK
|
|
streaming_decl(); // expected-error {{call to a streaming function requires 'sme'}}
|
|
streaming_fn_ptr(); // expected-error {{call to a streaming function requires 'sme'}}
|
|
}
|
|
|
|
void streaming_compatible_def2(void (*streaming_fn_ptr)(void) __arm_streaming,
|
|
void (*streaming_compatible_fn_ptr)(void) __arm_streaming_compatible)
|
|
__arm_streaming_compatible {
|
|
non_streaming_decl(); // OK
|
|
streaming_compatible_decl(); // OK
|
|
streaming_compatible_fn_ptr(); // OK
|
|
streaming_decl(); // expected-error {{call to a streaming function requires 'sme'}}
|
|
streaming_fn_ptr(); // expected-error {{call to a streaming function requires 'sme'}}
|
|
}
|
|
|
|
// Also test when call-site is not a function.
|
|
int streaming_decl_ret_int() __arm_streaming;
|
|
int x = streaming_decl_ret_int(); // expected-error {{call to a streaming function requires 'sme'}}
|
|
|
|
void sme_attrs_lambdas() {
|
|
[] __arm_locally_streaming () { return; }(); // expected-error {{function executed in streaming-SVE mode requires 'sme'}}
|
|
[] __arm_new("za") () { return; }(); // expected-error {{function using ZA state requires 'sme'}}
|
|
[] __arm_new("zt0") () { return; }(); // expected-error {{function using ZT0 state requires 'sme2'}}
|
|
}
|