llvm-project/clang/test/CodeGen/preserve-call-conv.c
antangelo ae1596a31a
[AArch64] Support preserve_none calling convention (#91046)
Adds AArch64 support for the `preserve_none` calling convention.
Registers X0-X7, X9-X15 and X19-X28 are caller save, and can be used to
pass arguments. Delegates to AAPCS for all other registers.

Closes #87423
2024-06-03 18:42:08 -04:00

28 lines
1.3 KiB
C

// RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm < %s | FileCheck %s --check-prefixes=CHECK,LINUX
// RUN: %clang_cc1 -triple arm64-unknown-unknown -emit-llvm < %s | FileCheck %s --check-prefixes=CHECK,LINUX
// RUN: %clang_cc1 -triple x86_64-unknown-windows-msvc -emit-llvm %s -o - | FileCheck %s
// RUN: %clang_cc1 -triple aarch64-unknown-windows-msvc -emit-llvm %s -o - | FileCheck %s
// RUN: %clang_cc1 -triple thumbv7-unknown-windows-msvc -emit-llvm %s -o - | FileCheck %s
// Check that the preserve_most calling convention attribute at the source level
// is lowered to the corresponding calling convention attrribute at the LLVM IR
// level.
void foo(void) __attribute__((preserve_most)) {
// CHECK-LABEL: define {{(dso_local )?}}preserve_mostcc void @foo()
}
// Check that the preserve_most calling convention attribute at the source level
// is lowered to the corresponding calling convention attrribute at the LLVM IR
// level.
void boo(void) __attribute__((preserve_all)) {
// CHECK-LABEL: define {{(dso_local )?}}preserve_allcc void @boo()
}
// Check that the preserve_none calling convention attribute at the source level
// is lowered to the corresponding calling convention attrribute at the LLVM IR
// level.
void bar(void) __attribute__((preserve_none)) {
// LINUX-LABEL: define {{(dso_local )?}}preserve_nonecc void @bar()
}