summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGen/arm-pcs.c
diff options
context:
space:
mode:
authorAnton Korobeynikov <asl@math.spbu.ru>2011-04-14 20:06:49 +0000
committerAnton Korobeynikov <asl@math.spbu.ru>2011-04-14 20:06:49 +0000
commit231e875b5c44db3197d548b8b7c16d1bc3d8a81e (patch)
treee3e1f7f51788639d1223864f031d251d347c038d /clang/test/CodeGen/arm-pcs.c
parentfdc33cbecd636a9218c30aed114ac6cfce6464f0 (diff)
downloadbcm5719-llvm-231e875b5c44db3197d548b8b7c16d1bc3d8a81e.tar.gz
bcm5719-llvm-231e875b5c44db3197d548b8b7c16d1bc3d8a81e.zip
Implement ARM pcs attribute. Basically it's another way of calling convention selection (AAPCS or
AAPCS+VFP), similar to fastcall / stdcall / whatevercall seen on x86. In particular, all library functions should always be AAPCS regardless of floating point ABI used. llvm-svn: 129534
Diffstat (limited to 'clang/test/CodeGen/arm-pcs.c')
-rw-r--r--clang/test/CodeGen/arm-pcs.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/test/CodeGen/arm-pcs.c b/clang/test/CodeGen/arm-pcs.c
new file mode 100644
index 00000000000..d722f84cebd
--- /dev/null
+++ b/clang/test/CodeGen/arm-pcs.c
@@ -0,0 +1,12 @@
+// RUN: %clang_cc1 -triple arm-none-linux-gnueabi -emit-llvm -w -o - < %s | FileCheck %s
+typedef int __attribute__((pcs("aapcs"))) (*aapcs_fn)(void);
+typedef int __attribute__((pcs("aapcs-vfp"))) (*aapcs_vfp_fn)(void);
+
+aapcs_fn bar;
+
+int foo(aapcs_vfp_fn baz) {
+// CHECK: define i32 @foo
+// CHECK: call arm_aapcscc
+// CHECK: call arm_aapcs_vfpcc
+ return bar() + baz();
+}
OpenPOWER on IntegriCloud