diff options
author | Tim Northover <tnorthover@apple.com> | 2014-03-29 15:09:45 +0000 |
---|---|---|
committer | Tim Northover <tnorthover@apple.com> | 2014-03-29 15:09:45 +0000 |
commit | a2ee433c8d99632419d4a13a66cc4d06eada4014 (patch) | |
tree | e6ab2db8facbc4c5ed2fb11df260db8138572ace /clang/test/CodeGen/asm_arm64.c | |
parent | af3698066a1ea2e5ab4cc08ae9a59620cf18adb7 (diff) | |
download | bcm5719-llvm-a2ee433c8d99632419d4a13a66cc4d06eada4014.tar.gz bcm5719-llvm-a2ee433c8d99632419d4a13a66cc4d06eada4014.zip |
ARM64: initial clang support commit.
This adds Clang support for the ARM64 backend. There are definitely
still some rough edges, so please bring up any issues you see with
this patch.
As with the LLVM commit though, we think it'll be more useful for
merging with AArch64 from within the tree.
llvm-svn: 205100
Diffstat (limited to 'clang/test/CodeGen/asm_arm64.c')
-rw-r--r-- | clang/test/CodeGen/asm_arm64.c | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/clang/test/CodeGen/asm_arm64.c b/clang/test/CodeGen/asm_arm64.c new file mode 100644 index 00000000000..0eaa347a851 --- /dev/null +++ b/clang/test/CodeGen/asm_arm64.c @@ -0,0 +1,45 @@ +// RUN: %clang_cc1 -triple arm64-apple-ios -emit-llvm -o - %s | FileCheck %s + +// rdar://9167275 + +int t1() +{ + int x; + __asm__("mov %0, 7" : "=r" (x)); + return x; +} + +long t2() +{ + long x; + __asm__("mov %0, 7" : "=r" (x)); + return x; +} + +long t3() +{ + long x; + __asm__("mov %w0, 7" : "=r" (x)); + return x; +} + +// rdar://9281206 + +void t4(long op) { + long x1; + asm ("mov x0, %1; svc #0;" : "=r"(x1) :"r"(op),"r"(x1) :"x0" ); +} + +// rdar://9394290 + +float t5(float x) { + __asm__("fadd %0, %0, %0" : "+w" (x)); + return x; +} + +// rdar://9865712 +void t6 (void *f, int g) { + // CHECK: t6 + // CHECK: call void asm "str $1, $0", "=*Q,r" + asm("str %1, %0" : "=Q"(f) : "r"(g)); +} |