summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen/preserve-call-conv.c
diff options
context:
space:
mode:
authorRoman Levenstein <rlevenstein@apple.com>2016-03-16 18:00:46 +0000
committerRoman Levenstein <rlevenstein@apple.com>2016-03-16 18:00:46 +0000
commit35aa5cecf25162f4a88cdf1dbfe3f8fc3ed1a91c (patch)
treecd10e5f88885e6322f34eff7c85816a107616cbc /clang/test/CodeGen/preserve-call-conv.c
parentbe37e62e0ceb6ba6777b8bd50924a4cc4cfa3f7d (diff)
downloadbcm5719-llvm-35aa5cecf25162f4a88cdf1dbfe3f8fc3ed1a91c.tar.gz
bcm5719-llvm-35aa5cecf25162f4a88cdf1dbfe3f8fc3ed1a91c.zip
Add attributes for preserve_mostcc/preserve_allcc calling conventions to the C/C++ front-end
Till now, preserve_mostcc/preserve_allcc calling convention attributes were only available at the LLVM IR level. This patch adds attributes for preserve_mostcc/preserve_allcc calling conventions to the C/C++ front-end. The code was mostly written by Juergen Ributzka. I just added support for the AArch64 target and tests. Differential Revision: http://reviews.llvm.org/D18025 llvm-svn: 263647
Diffstat (limited to 'clang/test/CodeGen/preserve-call-conv.c')
-rw-r--r--clang/test/CodeGen/preserve-call-conv.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/clang/test/CodeGen/preserve-call-conv.c b/clang/test/CodeGen/preserve-call-conv.c
new file mode 100644
index 00000000000..6e91a8489b4
--- /dev/null
+++ b/clang/test/CodeGen/preserve-call-conv.c
@@ -0,0 +1,17 @@
+// RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-llvm < %s | FileCheck %s
+// RUN: %clang_cc1 -triple arm64-unknown-unknown -emit-llvm < %s | 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() __attribute__((preserve_most)) {
+ // CHECK-LABEL: define 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() __attribute__((preserve_all)) {
+ // CHECK-LABEL: define preserve_allcc void @boo()
+}
+
OpenPOWER on IntegriCloud