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
61 lines
2.6 KiB
C++
61 lines
2.6 KiB
C++
// RUN: %clang_cc1 -triple aarch64-linux-android29 -fclangir -emit-cir %s -o %t.cir
|
|
// RUN: FileCheck --check-prefix=CIR --input-file=%t.cir %s
|
|
// RUN: %clang_cc1 -triple aarch64-linux-android29 -fclangir -emit-llvm %s -o %t-cir.ll
|
|
// RUN: FileCheck --check-prefix=LLVM --input-file=%t-cir.ll %s
|
|
// RUN: %clang_cc1 -triple aarch64-linux-android29 -emit-llvm %s -o %t.ll
|
|
// RUN: FileCheck --check-prefix=OGCG --input-file=%t.ll %s
|
|
|
|
// Verify that __attribute__((annotate(...))) on C++ entities works through
|
|
// the CXX ABI lowering pipeline. The CXXABILowering pass walks all attributes
|
|
// on functions/globals and asserts they are "legal" (i.e. don't need ABI
|
|
// conversion). cir::AnnotationAttr was added to that legal-list; this test
|
|
// covers that path by exercising annotated members and free functions in a
|
|
// translation unit that goes through C++ codegen (mangling, member functions,
|
|
// constructor emission).
|
|
|
|
// All globals are emitted before any function in CIR/LLVM/OGCG output;
|
|
// collect global-section checks up here so subsequent function CHECKs can
|
|
// rely on strict-order matching for the function section.
|
|
// CIR-DAG: cir.global external @{{.*ns.*g.*}} = #cir.int<5> : !s32i [#cir.annotation<"ns_global_ann">]
|
|
// LLVM-DAG: @{{.*ns.*g.*}} = global i32 5
|
|
// OGCG-DAG: @{{.*ns.*g.*}} = {{.*}}global i32 5
|
|
// OGCG-DAG: @llvm.global.annotations = appending global
|
|
|
|
// CIR-side LLVM lowering also emits @llvm.global.annotations.
|
|
// LLVM-DAG: @llvm.global.annotations = appending global
|
|
|
|
struct __attribute__((annotate("type_ann"))) Tagged {
|
|
int x;
|
|
__attribute__((annotate("method_ann")))
|
|
int get() { return x; }
|
|
|
|
__attribute__((annotate("static_method_ann")))
|
|
static int sget() { return 7; }
|
|
};
|
|
|
|
// CIR: cir.func {{.*}} @{{.*Tagged.*get.*}}({{.*}}) {{.*}}[#cir.annotation<"method_ann">]
|
|
// CIR: cir.func {{.*}} @{{.*Tagged.*sget.*}}() {{.*}}[#cir.annotation<"static_method_ann">]
|
|
|
|
// LLVM: define{{.*}} i32 @{{.*Tagged.*get.*}}
|
|
// LLVM: define{{.*}} i32 @{{.*Tagged.*sget.*}}
|
|
|
|
// OGCG-DAG: define{{.*}} i32 @{{.*Tagged.*get.*}}
|
|
// OGCG-DAG: define{{.*}} i32 @{{.*Tagged.*sget.*}}
|
|
|
|
__attribute__((annotate("free_fn_ann")))
|
|
int use_tagged(Tagged *t) {
|
|
return t->get() + Tagged::sget();
|
|
}
|
|
|
|
// CIR: cir.func {{.*}} @{{.*use_tagged.*}}({{.*}}) {{.*}}[#cir.annotation<"free_fn_ann">]
|
|
// LLVM: define{{.*}} i32 @{{.*use_tagged.*}}
|
|
// OGCG-DAG: define{{.*}} i32 @{{.*use_tagged.*}}
|
|
|
|
// Annotated namespace-scope global (C++ name mangling exercises a different
|
|
// path than C globals). The CIR-DAG / LLVM-DAG / OGCG-DAG checks for the
|
|
// emitted global live in the globals block at the top.
|
|
namespace ns {
|
|
__attribute__((annotate("ns_global_ann")))
|
|
int g = 5;
|
|
}
|