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
93 lines
5.1 KiB
C
93 lines
5.1 KiB
C
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
|
|
|
#if !__has_extension(statement_attributes_with_gnu_syntax)
|
|
#error "We should have statement attributes with GNU syntax support"
|
|
#endif
|
|
|
|
void foo(int i) {
|
|
|
|
__attribute__((unknown_attribute)); // expected-warning {{unknown attribute 'unknown_attribute' ignored}}
|
|
__attribute__(()) {}
|
|
__attribute__(()) if (0) {}
|
|
__attribute__(()) for (;;);
|
|
__attribute__(()) do {
|
|
__attribute__(()) continue;
|
|
}
|
|
while (0)
|
|
;
|
|
__attribute__(()) while (0);
|
|
|
|
__attribute__(()) switch (i) {
|
|
__attribute__(()) case 0 :
|
|
__attribute__(()) default :
|
|
__attribute__(()) break;
|
|
}
|
|
|
|
__attribute__(()) goto here;
|
|
__attribute__(()) here :
|
|
|
|
__attribute__(()) return;
|
|
|
|
__attribute__((noreturn)) {} // expected-error {{'noreturn' attribute cannot be applied to a statement}}
|
|
__attribute__((noreturn)) if (0) {} // expected-error {{'noreturn' attribute cannot be applied to a statement}}
|
|
__attribute__((noreturn)) for (;;); // expected-error {{'noreturn' attribute cannot be applied to a statement}}
|
|
__attribute__((noreturn)) do { // expected-error {{'noreturn' attribute cannot be applied to a statement}}
|
|
__attribute__((unavailable)) continue; // expected-error {{'unavailable' attribute cannot be applied to a statement}}
|
|
}
|
|
while (0)
|
|
;
|
|
__attribute__((unknown_attribute)) while (0); // expected-warning {{unknown attribute 'unknown_attribute' ignored}}
|
|
|
|
__attribute__((unused)) switch (i) { // expected-error {{'unused' attribute cannot be applied to a statement}}
|
|
__attribute__((uuid)) case 0: // expected-warning {{unknown attribute 'uuid' ignored}}
|
|
__attribute__((visibility(""))) default: // expected-error {{'visibility' attribute cannot be applied to a statement}}
|
|
__attribute__((carries_dependency)) break; // expected-error {{'carries_dependency' attribute cannot be applied to a statement}}
|
|
}
|
|
|
|
__attribute__((fastcall)) goto there; // expected-error {{'fastcall' attribute cannot be applied to a statement}}
|
|
__attribute__((noinline)) there : // expected-warning {{'noinline' attribute only applies to functions and statements}}
|
|
|
|
__attribute__((weakref)) return; // expected-error {{'weakref' attribute only applies to variables and functions}}
|
|
|
|
__attribute__((carries_dependency)); // expected-error {{'carries_dependency' attribute cannot be applied to a statement}}
|
|
__attribute__((carries_dependency)) {} // expected-error {{'carries_dependency' attribute cannot be applied to a statement}}
|
|
__attribute__((carries_dependency)) if (0) {} // expected-error {{'carries_dependency' attribute cannot be applied to a statement}}
|
|
__attribute__((carries_dependency)) for (;;); // expected-error {{'carries_dependency' attribute cannot be applied to a statement}}
|
|
__attribute__((carries_dependency)) do { // expected-error {{'carries_dependency' attribute cannot be applied to a statement}}
|
|
__attribute__((carries_dependency)) continue; // expected-error {{'carries_dependency' attribute cannot be applied to a statement}} ignored}}
|
|
}
|
|
while (0)
|
|
;
|
|
__attribute__((carries_dependency)) while (0); // expected-error {{'carries_dependency' attribute cannot be applied to a statement}}
|
|
|
|
__attribute__((carries_dependency)) switch (i) { // expected-error {{'carries_dependency' attribute cannot be applied to a statement}} ignored}}
|
|
__attribute__((carries_dependency)) case 0: // expected-error {{'carries_dependency' attribute cannot be applied to a statement}}
|
|
__attribute__((carries_dependency)) default: // expected-error {{'carries_dependency' attribute cannot be applied to a statement}}
|
|
__attribute__((carries_dependency)) break; // expected-error {{'carries_dependency' attribute cannot be applied to a statement}}
|
|
}
|
|
|
|
__attribute__((carries_dependency)) goto here; // expected-error {{'carries_dependency' attribute cannot be applied to a statement}}
|
|
|
|
__attribute__((carries_dependency)) return; // expected-error {{'carries_dependency' attribute cannot be applied to a statement}}
|
|
}
|
|
|
|
void bar(void);
|
|
|
|
void foobar(void) {
|
|
__attribute__((nomerge)) bar();
|
|
__attribute__(()) bar(); // expected-error {{expected identifier or '('}}
|
|
__attribute__((unused, nomerge)) bar(); // expected-error {{expected identifier or '('}}
|
|
__attribute__((nomerge, unused)) bar(); // expected-error {{expected identifier or '('}}
|
|
__attribute__((nomerge(1, 2))) bar(); // expected-error {{'nomerge' attribute takes no arguments}}
|
|
int x;
|
|
__attribute__((nomerge)) x = 10; // expected-warning {{'nomerge' attribute is ignored because there exists no call expression inside the statement}}
|
|
|
|
__attribute__((nomerge)) label : bar(); // expected-error {{'nomerge' attribute only applies to functions, statements and variables}}
|
|
}
|
|
|
|
int f(void);
|
|
|
|
__attribute__((nomerge)) static int (*fptr)(void);
|
|
__attribute__((nomerge)) static int i; // expected-warning {{'nomerge' attribute is ignored because 'i' is not a function pointer}}
|
|
struct buz {} __attribute__((nomerge)); // expected-error {{'nomerge' attribute only applies to functions, statements and variables}}
|