diff options
| author | Tim Northover <Tim.Northover@arm.com> | 2013-05-04 07:15:13 +0000 |
|---|---|---|
| committer | Tim Northover <Tim.Northover@arm.com> | 2013-05-04 07:15:13 +0000 |
| commit | 8ec8c4bf89c5e1bed3bcb3425e6e3fa347fea319 (patch) | |
| tree | 7ab2a936f598480a2c5b5c34f221d2a4c266e0d8 /clang/test | |
| parent | fa7a7b4f369de6f5a3f21240c1448df4a42f9be7 (diff) | |
| download | bcm5719-llvm-8ec8c4bf89c5e1bed3bcb3425e6e3fa347fea319.tar.gz bcm5719-llvm-8ec8c4bf89c5e1bed3bcb3425e6e3fa347fea319.zip | |
AArch64: teach Clang about __clear_cache intrinsic
libgcc provides a __clear_cache intrinsic on AArch64, much like it
does on 32-bit ARM.
llvm-svn: 181111
Diffstat (limited to 'clang/test')
| -rw-r--r-- | clang/test/CodeGen/builtins-aarch64.c | 6 | ||||
| -rw-r--r-- | clang/test/Sema/builtins-aarch64.c | 16 |
2 files changed, 22 insertions, 0 deletions
diff --git a/clang/test/CodeGen/builtins-aarch64.c b/clang/test/CodeGen/builtins-aarch64.c new file mode 100644 index 00000000000..8a93cb41fa4 --- /dev/null +++ b/clang/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/clang/test/Sema/builtins-aarch64.c b/clang/test/Sema/builtins-aarch64.c new file mode 100644 index 00000000000..03e03343eb9 --- /dev/null +++ b/clang/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}} +} |

