Home | History | Annotate | Download | only in CodeGen
      1 // RUN: %clang_cc1 -triple arm64-apple-ios -emit-llvm -o - %s | FileCheck %s
      2 
      3 // rdar://9167275
      4 
      5 int t1()
      6 {
      7   int x;
      8   __asm__("mov %0, 7" : "=r" (x));
      9   return x;
     10 }
     11 
     12 long t2()
     13 {
     14   long x;
     15   __asm__("mov %0, 7" : "=r" (x));
     16   return x;
     17 }
     18 
     19 long t3()
     20 {
     21   long x;
     22   __asm__("mov %w0, 7" : "=r" (x));
     23   return x;
     24 }
     25 
     26 // rdar://9281206
     27 
     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 
     35 float t5(float x) {
     36   __asm__("fadd %0, %0, %0" : "+w" (x));
     37   return x;
     38 }
     39 
     40 // rdar://9865712
     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