xref: /llvm-project/clang/test/CodeGen/inline-asm-aarch64-flag-output.c (revision 4ab76b77cee0e27510d5d5cb3072ee7e92d96eec)
1 // RUN: %clang_cc1 -O2 -emit-llvm %s -o - -triple aarch64 | FileCheck %s
2 
test_cceq(int a,int * b)3 int test_cceq(int a, int* b) {
4 // CHECK-LABEL: @test_cceq
5 // CHECK: = tail call { i32, i32 } asm "ands ${0:w}, ${0:w}, #3", "=r,={@cceq},0"(i32 %a)
6   asm("ands %w[a], %w[a], #3"
7       : [a] "+r"(a), "=@cceq"(*b));
8   return a;
9 }
10 
test_ccne(int a,int * b)11 int test_ccne(int a, int* b) {
12 // CHECK-LABEL: @test_ccne
13 // CHECK: = tail call { i32, i32 } asm "ands ${0:w}, ${0:w}, #3", "=r,={@ccne},0"(i32 %a)
14   asm("ands %w[a], %w[a], #3"
15       : [a] "+r"(a), "=@ccne"(*b));
16   return a;
17 }
18 
test_cccs(int a,int * b)19 int test_cccs(int a, int* b) {
20 // CHECK-LABEL: @test_cccs
21 // CHECK: = tail call { i32, i32 } asm "ands ${0:w}, ${0:w}, #3", "=r,={@cccs},0"(i32 %a)
22   asm("ands %w[a], %w[a], #3"
23       : [a] "+r"(a), "=@cccs"(*b));
24   return a;
25 }
26 
test_cchs(int a,int * b)27 int test_cchs(int a, int* b) {
28 // CHECK-LABEL: @test_cchs
29 // CHECK: = tail call { i32, i32 } asm "ands ${0:w}, ${0:w}, #3", "=r,={@cchs},0"(i32 %a)
30   asm("ands %w[a], %w[a], #3"
31       : [a] "+r"(a), "=@cchs"(*b));
32   return a;
33 }
34 
test_cccc(int a,int * b)35 int test_cccc(int a, int* b) {
36 // CHECK-LABEL: @test_cccc
37 // CHECK: = tail call { i32, i32 } asm "ands ${0:w}, ${0:w}, #3", "=r,={@cccc},0"(i32 %a)
38   asm("ands %w[a], %w[a], #3"
39       : [a] "+r"(a), "=@cccc"(*b));
40   return a;
41 }
42 
test_cclo(int a,int * b)43 int test_cclo(int a, int* b) {
44 // CHECK-LABEL: @test_cclo
45 // CHECK: = tail call { i32, i32 } asm "ands ${0:w}, ${0:w}, #3", "=r,={@cclo},0"(i32 %a)
46   asm("ands %w[a], %w[a], #3"
47       : [a] "+r"(a), "=@cclo"(*b));
48   return a;
49 }
50 
test_ccmi(int a,int * b)51 int test_ccmi(int a, int* b) {
52 // CHECK-LABEL: @test_ccmi
53 // CHECK: = tail call { i32, i32 } asm "ands ${0:w}, ${0:w}, #3", "=r,={@ccmi},0"(i32 %a)
54   asm("ands %w[a], %w[a], #3"
55       : [a] "+r"(a), "=@ccmi"(*b));
56   return a;
57 }
58 
test_ccpl(int a,int * b)59 int test_ccpl(int a, int* b) {
60 // CHECK-LABEL: @test_ccpl
61 // CHECK: = tail call { i32, i32 } asm "ands ${0:w}, ${0:w}, #3", "=r,={@ccpl},0"(i32 %a)
62   asm("ands %w[a], %w[a], #3"
63       : [a] "+r"(a), "=@ccpl"(*b));
64   return a;
65 }
66 
test_ccvs(int a,int * b)67 int test_ccvs(int a, int* b) {
68 // CHECK-LABEL: @test_ccvs
69 // CHECK: = tail call { i32, i32 } asm "ands ${0:w}, ${0:w}, #3", "=r,={@ccvs},0"(i32 %a)
70   asm("ands %w[a], %w[a], #3"
71       : [a] "+r"(a), "=@ccvs"(*b));
72   return a;
73 }
74 
test_ccvc(int a,int * b)75 int test_ccvc(int a, int* b) {
76 // CHECK-LABEL: @test_ccvc
77 // CHECK: = tail call { i32, i32 } asm "ands ${0:w}, ${0:w}, #3", "=r,={@ccvc},0"(i32 %a)
78   asm("ands %w[a], %w[a], #3"
79       : [a] "+r"(a), "=@ccvc"(*b));
80   return a;
81 }
82 
test_cchi(int a,int * b)83 int test_cchi(int a, int* b) {
84 // CHECK-LABEL: @test_cchi
85 // CHECK: = tail call { i32, i32 } asm "ands ${0:w}, ${0:w}, #3", "=r,={@cchi},0"(i32 %a)
86   asm("ands %w[a], %w[a], #3"
87       : [a] "+r"(a), "=@cchi"(*b));
88   return a;
89 }
90 
test_ccls(int a,int * b)91 int test_ccls(int a, int* b) {
92 // CHECK-LABEL: @test_ccls
93 // CHECK: = tail call { i32, i32 } asm "ands ${0:w}, ${0:w}, #3", "=r,={@ccls},0"(i32 %a)
94   asm("ands %w[a], %w[a], #3"
95       : [a] "+r"(a), "=@ccls"(*b));
96   return a;
97 }
98 
99 
test_ccge(int a,int * b)100 int test_ccge(int a, int* b) {
101 // CHECK-LABEL: @test_ccge
102 // CHECK: = tail call { i32, i32 } asm "ands ${0:w}, ${0:w}, #3", "=r,={@ccge},0"(i32 %a)
103   asm("ands %w[a], %w[a], #3"
104       : [a] "+r"(a), "=@ccge"(*b));
105   return a;
106 }
107 
test_cclt(int a,int * b)108 int test_cclt(int a, int* b) {
109 // CHECK-LABEL: @test_cclt
110 // CHECK: = tail call { i32, i32 } asm "ands ${0:w}, ${0:w}, #3", "=r,={@cclt},0"(i32 %a)
111   asm("ands %w[a], %w[a], #3"
112       : [a] "+r"(a), "=@cclt"(*b));
113   return a;
114 }
115 
test_ccgt(int a,int * b)116 int test_ccgt(int a, int* b) {
117 // CHECK-LABEL: @test_ccgt
118 // CHECK: = tail call { i32, i32 } asm "ands ${0:w}, ${0:w}, #3", "=r,={@ccgt},0"(i32 %a)
119   asm("ands %w[a], %w[a], #3"
120       : [a] "+r"(a), "=@ccgt"(*b));
121   return a;
122 }
123 
test_ccle(int a,int * b)124 int test_ccle(int a, int* b) {
125 // CHECK-LABEL: @test_ccle
126 // CHECK: = tail call { i32, i32 } asm "ands ${0:w}, ${0:w}, #3", "=r,={@ccle},0"(i32 %a)
127   asm("ands %w[a], %w[a], #3"
128       : [a] "+r"(a), "=@ccle"(*b));
129   return a;
130 }
131