xref: /llvm-project/clang/test/CodeGen/asm_arm64.c (revision 0f1c1be1968076d6f96f8a7bcc4a15cf195ecd97)
1 // RUN: %clang_cc1 -triple arm64-apple-ios -emit-llvm -o - %s | FileCheck %s
2 
t1(void)3 int t1(void)
4 {
5   int x;
6   __asm__("mov %0, 7" : "=r" (x));
7   return x;
8 }
9 
t2(void)10 long t2(void)
11 {
12   long x;
13   __asm__("mov %0, 7" : "=r" (x));
14   return x;
15 }
16 
t3(void)17 long t3(void)
18 {
19   long x;
20   __asm__("mov %w0, 7" : "=r" (x));
21   return x;
22 }
23 
t4(long op)24 void t4(long op) {
25   long x1;
26   asm ("mov x0, %1; svc #0;" : "=r"(x1) :"r"(op),"r"(x1) :"x0" );
27 }
28 
t5(float x)29 float t5(float x) {
30   __asm__("fadd %0, %0, %0" : "+w" (x));
31   return x;
32 }
33 
t6(void * f,int g)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 }
39