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