aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorTim Northover <Tim.Northover@arm.com>2013-05-04 07:15:13 +0000
committerTim Northover <Tim.Northover@arm.com>2013-05-04 07:15:13 +0000
commitff920eec4d449bee560d8d99636ad0eb50cd9d8d (patch)
treedfb0f682d851cc10e90ac9c5ec479a0d01e4a8a1 /test
parente96515ad88309260db10cc0cdd2d3e33deab7d31 (diff)
AArch64: teach Clang about __clear_cache intrinsic
libgcc provides a __clear_cache intrinsic on AArch64, much like it does on 32-bit ARM. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181111 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/CodeGen/builtins-aarch64.c6
-rw-r--r--test/Sema/builtins-aarch64.c16
2 files changed, 22 insertions, 0 deletions
diff --git a/test/CodeGen/builtins-aarch64.c b/test/CodeGen/builtins-aarch64.c
new file mode 100644
index 0000000000..8a93cb41fa
--- /dev/null
+++ b/test/CodeGen/builtins-aarch64.c
@@ -0,0 +1,6 @@
+// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -O3 -emit-llvm -o - %s | FileCheck %s
+
+void f0(char *a, char *b) {
+ __clear_cache(a,b);
+// CHECK: call {{.*}} @__clear_cache
+}
diff --git a/test/Sema/builtins-aarch64.c b/test/Sema/builtins-aarch64.c
new file mode 100644
index 0000000000..03e03343eb
--- /dev/null
+++ b/test/Sema/builtins-aarch64.c
@@ -0,0 +1,16 @@
+// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -fsyntax-only -verify %s
+
+void test_clear_cache_chars(char *start, char *end) {
+ __clear_cache(start, end);
+}
+
+void test_clear_cache_voids(void *start, void *end) {
+ __clear_cache(start, end);
+}
+
+void test_clear_cache_no_args() {
+ // AArch32 version of this is variadic (at least syntactically).
+ // However, on AArch64 GCC does not permit this call and the
+ // implementation I've seen would go disastrously wrong.
+ __clear_cache(); // expected-error {{too few arguments to function call}}
+}