| 1 |
// RUN: %clang_cc1 -triple arm64-apple-ios -emit-llvm -o - %s | FileCheck %s |
| 2 |
|
| 3 |
int t1(void) |
| 4 |
{ |
| 5 |
int x; |
| 6 |
__asm__("mov %0, 7" : "=r" (x)); |
| 7 |
return x; |
| 8 |
} |
| 9 |
|
| 10 |
long t2(void) |
| 11 |
{ |
| 12 |
long x; |
| 13 |
__asm__("mov %0, 7" : "=r" (x)); |
| 14 |
return x; |
| 15 |
} |
| 16 |
|
| 17 |
long t3(void) |
| 18 |
{ |
| 19 |
long x; |
| 20 |
__asm__("mov %w0, 7" : "=r" (x)); |
| 21 |
return x; |
| 22 |
} |
| 23 |
|
| 24 |
void t4(long op) { |
| 25 |
long x1; |
| 26 |
asm ("mov x0, %1; svc #0;" : "=r"(x1) :"r"(op),"r"(x1) :"x0" ); |
| 27 |
} |
| 28 |
|
| 29 |
float t5(float x) { |
| 30 |
__asm__("fadd %0, %0, %0" : "+w" (x)); |
| 31 |
return x; |
| 32 |
} |
| 33 |
|
| 34 |
void t6 (void *f, int g) { |
| 35 |
// CHECK: t6 |
| 36 |
// CHECK: call void asm "str $1, $0", "=*Q,r" |
| 37 |
asm("str %1, %0" : "=Q"(f) : "r"(g)); |
| 38 |
} |