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
99 lines
4.8 KiB
C++
99 lines
4.8 KiB
C++
// RUN: %clang_cc1 %s -ast-print | FileCheck %s
|
|
// RUN: %clang_cc1 -emit-pch -o %t.ast %s
|
|
// RUN: %clang_cc1 %t.ast -ast-print | FileCheck %s
|
|
|
|
// CHECK: void *aa() __attribute__((assume_aligned(64)));
|
|
void *aa() __attribute__((assume_aligned(64)));
|
|
|
|
// CHECK: void *aa2() __attribute__((assume_aligned(64, 8)));
|
|
void *aa2() __attribute__((assume_aligned(64, 8)));
|
|
|
|
// CHECK: void xla(int a) __attribute__((xray_log_args(1)));
|
|
void xla(int a) __attribute__((xray_log_args(1)));
|
|
|
|
// CHECK: void *as2(int, int) __attribute__((alloc_size(1, 2)));
|
|
void *as2(int, int) __attribute__((alloc_size(1, 2)));
|
|
// CHECK: void *as1(void *, int) __attribute__((alloc_size(2)));
|
|
void *as1(void *, int) __attribute__((alloc_size(2)));
|
|
|
|
// CHECK: void fmt(int, const char *, ...) __attribute__((format(printf, 2, 3)));
|
|
void fmt(int, const char *, ...) __attribute__((format(printf, 2, 3)));
|
|
|
|
// CHECK: char *fmta(int, const char *) __attribute__((format_arg(2)));
|
|
char *fmta(int, const char *) __attribute__((format_arg(2)));
|
|
|
|
// CHECK: void nn(int *, int *) __attribute__((nonnull(1, 2)));
|
|
void nn(int *, int *) __attribute__((nonnull(1, 2)));
|
|
|
|
// CHECK: int *aa(int i) __attribute__((alloc_align(1)));
|
|
int *aa(int i) __attribute__((alloc_align(1)));
|
|
|
|
// CHECK: void ownt(int *, int *) __attribute__((ownership_takes(foo, 1, 2)));
|
|
void ownt(int *, int *) __attribute__((ownership_takes(foo, 1, 2)));
|
|
// CHECK: void ownh(int *, int *) __attribute__((ownership_holds(foo, 1, 2)));
|
|
void ownh(int *, int *) __attribute__((ownership_holds(foo, 1, 2)));
|
|
// CHECK: void *ownr(int) __attribute__((ownership_returns(foo, 1)));
|
|
void *ownr(int) __attribute__((ownership_returns(foo, 1)));
|
|
|
|
// CHECK: void awtt(int, int, ...) __attribute__((argument_with_type_tag(foo, 3, 2)));
|
|
void awtt(int, int, ...) __attribute__((argument_with_type_tag(foo, 3, 2)));
|
|
// CHECK: void pwtt(void *, int) __attribute__((pointer_with_type_tag(foo, 1, 2)));
|
|
void pwtt(void *, int) __attribute__((pointer_with_type_tag(foo, 1, 2)));
|
|
|
|
class C {
|
|
// CHECK: void xla(int a) __attribute__((xray_log_args(2)));
|
|
void xla(int a) __attribute__((xray_log_args(2)));
|
|
|
|
// CHECK: void *as2(int, int) __attribute__((alloc_size(2, 3)));
|
|
void *as2(int, int) __attribute__((alloc_size(2, 3)));
|
|
// CHECK: void *as1(void *, int) __attribute__((alloc_size(3)));
|
|
void *as1(void *, int) __attribute__((alloc_size(3)));
|
|
|
|
// CHECK: void fmt(int, const char *, ...) __attribute__((format(printf, 3, 4)));
|
|
void fmt(int, const char *, ...) __attribute__((format(printf, 3, 4)));
|
|
|
|
// CHECK: char *fmta(int, const char *) __attribute__((format_arg(3)));
|
|
char *fmta(int, const char *) __attribute__((format_arg(3)));
|
|
|
|
// CHECK: void nn(int *, int *) __attribute__((nonnull(2, 3)));
|
|
void nn(int *, int *) __attribute__((nonnull(2, 3)));
|
|
|
|
// CHECK: int *aa(int i) __attribute__((alloc_align(2)));
|
|
int *aa(int i) __attribute__((alloc_align(2)));
|
|
|
|
// CHECK: void ownt(int *, int *) __attribute__((ownership_takes(foo, 2, 3)));
|
|
void ownt(int *, int *) __attribute__((ownership_takes(foo, 2, 3)));
|
|
// CHECK: void ownh(int *, int *) __attribute__((ownership_holds(foo, 2, 3)));
|
|
void ownh(int *, int *) __attribute__((ownership_holds(foo, 2, 3)));
|
|
// CHECK: void *ownr(int) __attribute__((ownership_returns(foo, 2)));
|
|
void *ownr(int) __attribute__((ownership_returns(foo, 2)));
|
|
|
|
// CHECK: void awtt(int, int, ...) __attribute__((argument_with_type_tag(foo, 4, 3)));
|
|
void awtt(int, int, ...) __attribute__((argument_with_type_tag(foo, 4, 3)));
|
|
// CHECK: void pwtt(void *, int) __attribute__((pointer_with_type_tag(foo, 2, 3)));
|
|
void pwtt(void *, int) __attribute__((pointer_with_type_tag(foo, 2, 3)));
|
|
};
|
|
|
|
#define ANNOTATE_ATTR __attribute__((annotate("Annotated")))
|
|
ANNOTATE_ATTR int annotated_attr ANNOTATE_ATTR = 0;
|
|
// CHECK: __attribute__((annotate("Annotated"))) int annotated_attr __attribute__((annotate("Annotated"))) = 0;
|
|
|
|
void increment() { [[clang::annotate("Annotated")]] annotated_attr++; }
|
|
// CHECK: {{\[\[}}clang::annotate("Annotated")]] annotated_attr++;
|
|
|
|
// FIXME: We do not print the attribute as written after the type specifier.
|
|
int ANNOTATE_ATTR annotated_attr_fixme = 0;
|
|
// CHECK: __attribute__((annotate("Annotated"))) int annotated_attr_fixme = 0;
|
|
|
|
#define NONNULL_ATTR __attribute__((nonnull(1)))
|
|
ANNOTATE_ATTR NONNULL_ATTR void fn_non_null_annotated_attr(int *) __attribute__((annotate("AnnotatedRHS")));
|
|
// CHECK:__attribute__((annotate("Annotated"))) __attribute__((nonnull(1))) void fn_non_null_annotated_attr(int *) __attribute__((annotate("AnnotatedRHS")));
|
|
|
|
[[gnu::nonnull(1)]] [[gnu::always_inline]] void cxx11_attr(int*) ANNOTATE_ATTR;
|
|
// CHECK: {{\[\[}}gnu::nonnull(1)]] {{\[\[}}gnu::always_inline]] void cxx11_attr(int *) __attribute__((annotate("Annotated")));
|
|
|
|
struct Foo;
|
|
|
|
// CHECK: void as_member_fn_ptr(int *(Foo::*member)(int) __attribute__((alloc_size(1))));
|
|
void as_member_fn_ptr(int* (Foo::*member)(int) __attribute__((alloc_size(1))));
|