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
104 lines
4.6 KiB
C++
104 lines
4.6 KiB
C++
// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fclangir -emit-cir %s -o %t.cir
|
|
// RUN: FileCheck --input-file=%t.cir %s -check-prefix=CIR
|
|
// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fclangir -emit-llvm %s -o %t.ll
|
|
// RUN: FileCheck --input-file=%t.ll %s -check-prefix=LLVM
|
|
// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm %s -o %t.ll
|
|
// RUN: FileCheck --input-file=%t.ll %s -check-prefix=LLVM
|
|
|
|
extern "C" {
|
|
// CIR: cir.func{{.*}}@returns_twice() attributes {{{.*}}nothrow, returns_twice} {
|
|
// LLVM: Function Attrs:{{.*}}returns_twice
|
|
// LLVM-NEXT: define{{.*}}@returns_twice() #[[RT_ATTR:.*]] {
|
|
__attribute__((returns_twice))
|
|
void returns_twice() {}
|
|
// CIR: cir.func{{.*}}@cold() attributes {{{.*}}cold, nothrow} {
|
|
// LLVM: Function Attrs:{{.*}}cold
|
|
// LLVM-NEXT: define{{.*}}@cold() #[[COLD_ATTR:.*]] {
|
|
__attribute__((cold))
|
|
void cold() {}
|
|
// CIR: cir.func{{.*}}@hot() attributes {{{.*}}hot, nothrow} {
|
|
// LLVM: Function Attrs:{{.*}}hot
|
|
// LLVM-NEXT: define{{.*}}@hot() #[[HOT_ATTR:.*]] {
|
|
__attribute__((hot))
|
|
void hot() {}
|
|
// CIR: cir.func{{.*}}@nodupes() attributes {{{.*}}noduplicate, nothrow} {
|
|
// LLVM: Function Attrs:{{.*}}noduplicate
|
|
// LLVM-NEXT: define{{.*}}@nodupes() #[[ND_ATTR:.*]] {
|
|
__attribute__((noduplicate))
|
|
void nodupes() {}
|
|
// CIR: cir.func{{.*}}@convergent() attributes {{{.*}}convergent, nothrow} {
|
|
// LLVM: Function Attrs:{{.*}}convergent
|
|
// LLVM-NEXT: define{{.*}}@convergent() #[[CONV_ATTR:.*]] {
|
|
__attribute__((convergent))
|
|
void convergent() {}
|
|
|
|
// CIR: cir.func{{.*}}@no_caller_saved_registers() attributes {{{.*}}no_caller_saved_registers, nothrow} {
|
|
// LLVM: Function Attrs:
|
|
// LLVM-NOT: no_caller_saved_registers
|
|
// LLVM-NEXT: define{{.*}}@no_caller_saved_registers() #[[NCSR_ATTR:.*]] {
|
|
__attribute__((no_caller_saved_registers))
|
|
void no_caller_saved_registers() {}
|
|
|
|
// CIR: cir.func{{.*}}@leaf() attributes {{{.*}}nocallback, nothrow} {
|
|
// LLVM: Function Attrs:
|
|
// LLVM-NOT: leaf
|
|
// LLVM-NEXT: define{{.*}}@leaf() #[[LEAF_ATTR:.*]] {
|
|
__attribute__((leaf))
|
|
void leaf() {}
|
|
|
|
// CIR: cir.func{{.*}}@modular_format({{.*}}) attributes {{{.*}}modular_format = "kprintf,1,2,someIdent,someStr,aspect,aspect2", nothrow} {
|
|
// LLVM: Function Attrs:
|
|
// LLVM-NOT:modular_format
|
|
// LLVM-NEXT: define{{.*}}@modular_format({{.*}}) #[[MOD_FORMAT_ATTR:.*]] {
|
|
__attribute__((format(kprintf, 1, 2)))
|
|
__attribute__((modular_format(someIdent, "someStr", "aspect", "aspect2")))
|
|
void modular_format(const char *c, ...) {}
|
|
|
|
void caller() {
|
|
// CIR: cir.call @returns_twice() {returns_twice} : () -> ()
|
|
// LLVM: call void @returns_twice() #[[RT_CALL_ATTR:.*]]
|
|
returns_twice();
|
|
// CIR: cir.call @cold() {cold} : () -> ()
|
|
// LLVM: call void @cold() #[[COLD_CALL_ATTR:.*]]
|
|
cold();
|
|
// CIR: cir.call @hot() {hot} : () -> ()
|
|
// LLVM: call void @hot() #[[HOT_CALL_ATTR:.*]]
|
|
hot();
|
|
// CIR: cir.call @nodupes() {noduplicate} : () -> ()
|
|
// LLVM: call void @nodupes() #[[ND_CALL_ATTR:.*]]
|
|
nodupes();
|
|
// CIR: cir.call @convergent() {convergent} : () -> ()
|
|
// LLVM: call void @convergent() #[[CONV_CALL_ATTR:.*]]
|
|
convergent();
|
|
|
|
// CIR: cir.call @no_caller_saved_registers() {no_caller_saved_registers} : () -> ()
|
|
// LLVM: call void @no_caller_saved_registers() #[[NCSR_CALL_ATTR:.*]]
|
|
no_caller_saved_registers();
|
|
|
|
// CIR: cir.call @leaf() {nocallback} : () -> ()
|
|
// LLVM: call void @leaf() #[[LEAF_CALL_ATTR:.*]]
|
|
leaf();
|
|
|
|
// CIR: cir.call @modular_format({{.*}}) {modular_format = "kprintf,1,2,someIdent,someStr,aspect,aspect2"} :
|
|
// LLVM: call void {{.*}}@modular_format({{.*}}) #[[MOD_FORMAT_CALL_ATTR:.*]]
|
|
modular_format("");
|
|
}
|
|
}
|
|
|
|
// LLVM: attributes #[[RT_ATTR]] = {{.*}}returns_twice
|
|
// LLVM: attributes #[[COLD_ATTR]] = {{.*}}cold
|
|
// LLVM: attributes #[[HOT_ATTR]] = {{.*}}hot
|
|
// LLVM: attributes #[[ND_ATTR]] = {{.*}}noduplicate
|
|
// LLVM: attributes #[[CONV_ATTR]] = {{.*}}convergent
|
|
// LLVM: attributes #[[NCSR_ATTR]] = {{.*}}no_caller_saved_registers
|
|
// LLVM: attributes #[[LEAF_ATTR]] = {{.*}}nocallback
|
|
// LLVM: attributes #[[MOD_FORMAT_ATTR]] = {{.*}}"modular-format"="kprintf,1,2,someIdent,someStr,aspect,aspect2"
|
|
// LLVM: attributes #[[RT_CALL_ATTR]] = {{.*}}returns_twice
|
|
// LLVM: attributes #[[COLD_CALL_ATTR]] = {{.*}}cold
|
|
// LLVM: attributes #[[HOT_CALL_ATTR]] = {{.*}}hot
|
|
// LLVM: attributes #[[ND_CALL_ATTR]] = {{.*}}noduplicate
|
|
// LLVM: attributes #[[CONV_CALL_ATTR]] = {{.*}}convergent
|
|
// LLVM: attributes #[[NCSR_CALL_ATTR]] = {{.*}}no_caller_saved_registers
|
|
// LLVM: attributes #[[LEAF_CALL_ATTR]] = {{.*}}nocallback
|
|
// LLVM: attributes #[[MOD_FORMAT_CALL_ATTR]] = {{.*}}"modular-format"="kprintf,1,2,someIdent,someStr,aspect,aspect2"
|