1 // RUN: %clang_cc1 -triple i686 %s -emit-llvm -o - | FileCheck %s
2 // RUN: %clang_cc1 -triple x86_64 %s -emit-llvm -o - | FileCheck %s
3 // RUN: %clang_cc1 -triple arm %s -emit-llvm -o - | FileCheck %s
4 // RUN: %clang_cc1 -triple mips %s -emit-llvm -o - | FileCheck %s
5 // RUN: %clang_cc1 -triple mipsel %s -emit-llvm -o - | FileCheck %s
6 // RUN: %clang_cc1 -triple powerpc %s -emit-llvm -o - | FileCheck %s
7 // RUN: %clang_cc1 -triple powerpc64 %s -emit-llvm -o - | FileCheck %s
8 // RUN: %clang_cc1 -triple s390x %s -emit-llvm -o - | FileCheck %s
9 // RUN: %clang_cc1 -triple sparc %s -emit-llvm -o - | FileCheck %s
10 // RUN: %clang_cc1 -triple sparcv9 %s -emit-llvm -o - | FileCheck %s
11 // RUN: %clang_cc1 -triple thumb %s -emit-llvm -o - | FileCheck %s
20 // CHECK: call void asm "foo $1,$0", "=*m,*m[[CLOBBERS:[a-zA-Z0-9@%{},~_$ ]*\"]](ptr elementtype(i32) {{[a-zA-Z0-9@%]+}}, ptr elementtype(i32) {{[a-zA-Z0-9@%]+}})
21 asm("foo %1,%0" : "=m" (mout0
) : "m" (min1
));
27 register int out0
= 0;
28 register int index
= 1;
29 // Doesn't really do an offset...
30 //asm("foo %1, %2,%0" : "=r" (out0) : "o" (min1));
36 // asm("foo %1,%0" : "=m" (mout0) : "V" (min1));
42 register int out0
= 0;
44 // CHECK: call i32 asm "foo $1,$0", "=r,<r[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
45 asm("foo %1,%0" : "=r" (out0
) : "<r" (in1
));
46 // CHECK: call i32 asm "foo $1,$0", "=r,r<[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
47 asm("foo %1,%0" : "=r" (out0
) : "r<" (in1
));
53 register int out0
= 0;
55 // CHECK: call i32 asm "foo $1,$0", "=r,>r[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
56 asm("foo %1,%0" : "=r" (out0
) : ">r" (in1
));
57 // CHECK: call i32 asm "foo $1,$0", "=r,r>[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
58 asm("foo %1,%0" : "=r" (out0
) : "r>" (in1
));
64 register int out0
= 0;
66 // CHECK: call i32 asm "foo $1,$0", "=r,r[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
67 asm("foo %1,%0" : "=r" (out0
) : "r" (in1
));
73 register int out0
= 0;
74 // CHECK: call i32 asm "foo $1,$0", "=r,i[[CLOBBERS]](i32 1)
75 asm("foo %1,%0" : "=r" (out0
) : "i" (1));
81 register int out0
= 0;
82 // CHECK: call i32 asm "foo $1,$0", "=r,n[[CLOBBERS]](i32 1)
83 asm("foo %1,%0" : "=r" (out0
) : "n" (1));
89 register double out0
= 0.0;
90 // CHECK: call double asm "foo $1,$0", "=r,E[[CLOBBERS]](double {{[0-9.eE+-]+}})
91 asm("foo %1,%0" : "=r" (out0
) : "E" (1.0e+01));
97 register double out0
= 0.0;
98 // CHECK: call double asm "foo $1,$0", "=r,F[[CLOBBERS]](double {{[0-9.eE+-]+}})
99 asm("foo %1,%0" : "=r" (out0
) : "F" (1.0));
105 register int out0
= 0;
106 //asm("foo %1,%0" : "=r" (out0) : "s" (single_s));
112 register int out0
= 0;
113 register int in1
= 1;
114 // CHECK: call i32 asm "foo $1,$0", "=r,imr[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
115 asm("foo %1,%0" : "=r" (out0
) : "g" (in1
));
116 // CHECK: call i32 asm "foo $1,$0", "=r,imr[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
117 asm("foo %1,%0" : "=r" (out0
) : "g" (min1
));
118 // CHECK: call i32 asm "foo $1,$0", "=r,imr[[CLOBBERS]](i32 1)
119 asm("foo %1,%0" : "=r" (out0
) : "g" (1));
125 register int out0
= 0;
126 register int in1
= 1;
127 // CHECK: call i32 asm "foo $1,$0", "=r,X[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
128 asm("foo %1,%0" : "=r" (out0
) : "X" (in1
));
129 // CHECK: call i32 asm "foo $1,$0", "=r,X[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
130 asm("foo %1,%0" : "=r" (out0
) : "X" (min1
));
131 // CHECK: call i32 asm "foo $1,$0", "=r,X[[CLOBBERS]](i32 1)
132 asm("foo %1,%0" : "=r" (out0
) : "X" (1));
133 // CHECK: call i32 asm "foo $1,$0", "=r,X[[CLOBBERS]](ptr {{[a-zA-Z0-9@%]+}})
134 asm("foo %1,%0" : "=r" (out0
) : "X" (marray
));
135 // CHECK: call i32 asm "foo $1,$0", "=r,X[[CLOBBERS]](double {{[0-9.eE+-]+}})
136 asm("foo %1,%0" : "=r" (out0
) : "X" (1.0e+01));
137 // CHECK: call i32 asm "foo $1,$0", "=r,X[[CLOBBERS]](double {{[0-9.eE+-]+}})
138 asm("foo %1,%0" : "=r" (out0
) : "X" (1.0));
144 register int out0
= 0;
145 // Constraint converted differently on different platforms moved to platform-specific.
146 // : call i32 asm "foo $1,$0", "=r,im[[CLOBBERS]](ptr getelementptr inbounds ([2 x i32], ptr {{[a-zA-Z0-9@%]+}}, i{{32|64}} 0, i{{32|64}} 0))
147 asm("foo %1,%0" : "=r" (out0
) : "p" (marray
));
153 // CHECK: call void asm "foo $1,$0", "=*m|r,m|r[[CLOBBERS]](ptr elementtype(i32) {{[a-zA-Z0-9@%]+}}, i32 {{[a-zA-Z0-9@%]+}})
154 asm("foo %1,%0" : "=m,r" (mout0
) : "m,r" (min1
));
160 register int out0
= 0;
161 register int index
= 1;
162 // Doesn't really do an offset...
163 //asm("foo %1, %2,%0" : "=r,r" (out0) : "r,o" (min1));
169 // asm("foo %1,%0" : "=m,r" (mout0) : "r,V" (min1));
175 register int out0
= 0;
176 register int in1
= 1;
177 // CHECK: call i32 asm "foo $1,$0", "=r|r,r|<r[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
178 asm("foo %1,%0" : "=r,r" (out0
) : "r,<r" (in1
));
179 // CHECK: call i32 asm "foo $1,$0", "=r|r,r|r<[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
180 asm("foo %1,%0" : "=r,r" (out0
) : "r,r<" (in1
));
186 register int out0
= 0;
187 register int in1
= 1;
188 // CHECK: call i32 asm "foo $1,$0", "=r|r,r|>r[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
189 asm("foo %1,%0" : "=r,r" (out0
) : "r,>r" (in1
));
190 // CHECK: call i32 asm "foo $1,$0", "=r|r,r|r>[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
191 asm("foo %1,%0" : "=r,r" (out0
) : "r,r>" (in1
));
197 register int out0
= 0;
198 register int in1
= 1;
199 // CHECK: call i32 asm "foo $1,$0", "=r|r,r|m[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
200 asm("foo %1,%0" : "=r,r" (out0
) : "r,m" (in1
));
206 register int out0
= 0;
207 // CHECK: call i32 asm "foo $1,$0", "=r|r,r|i[[CLOBBERS]](i32 1)
208 asm("foo %1,%0" : "=r,r" (out0
) : "r,i" (1));
214 register int out0
= 0;
215 // CHECK: call i32 asm "foo $1,$0", "=r|r,r|n[[CLOBBERS]](i32 1)
216 asm("foo %1,%0" : "=r,r" (out0
) : "r,n" (1));
222 register double out0
= 0.0;
223 // CHECK: call double asm "foo $1,$0", "=r|r,r|E[[CLOBBERS]](double {{[0-9.eE+-]+}})
224 asm("foo %1,%0" : "=r,r" (out0
) : "r,E" (1.0e+01));
230 register double out0
= 0.0;
231 // CHECK: call double asm "foo $1,$0", "=r|r,r|F[[CLOBBERS]](double {{[0-9.eE+-]+}})
232 asm("foo %1,%0" : "=r,r" (out0
) : "r,F" (1.0));
238 register int out0
= 0;
239 //asm("foo %1,%0" : "=r,r" (out0) : "r,s" (multi_s));
245 register int out0
= 0;
246 register int in1
= 1;
247 // CHECK: call i32 asm "foo $1,$0", "=r|r,r|imr[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
248 asm("foo %1,%0" : "=r,r" (out0
) : "r,g" (in1
));
249 // CHECK: call i32 asm "foo $1,$0", "=r|r,r|imr[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
250 asm("foo %1,%0" : "=r,r" (out0
) : "r,g" (min1
));
251 // CHECK: call i32 asm "foo $1,$0", "=r|r,r|imr[[CLOBBERS]](i32 1)
252 asm("foo %1,%0" : "=r,r" (out0
) : "r,g" (1));
258 register int out0
= 0;
259 register int in1
= 1;
260 // CHECK: call i32 asm "foo $1,$0", "=r|r,r|X[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
261 asm("foo %1,%0" : "=r,r" (out0
) : "r,X" (in1
));
262 // CHECK: call i32 asm "foo $1,$0", "=r|r,r|X[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
263 asm("foo %1,%0" : "=r,r" (out0
) : "r,X" (min1
));
264 // CHECK: call i32 asm "foo $1,$0", "=r|r,r|X[[CLOBBERS]](i32 1)
265 asm("foo %1,%0" : "=r,r" (out0
) : "r,X" (1));
266 // CHECK: call i32 asm "foo $1,$0", "=r|r,r|X[[CLOBBERS]](ptr {{[a-zA-Z0-9@%]+}})
267 asm("foo %1,%0" : "=r,r" (out0
) : "r,X" (marray
));
268 // CHECK: call i32 asm "foo $1,$0", "=r|r,r|X[[CLOBBERS]](double {{[0-9.eE+-]+}})
269 asm("foo %1,%0" : "=r,r" (out0
) : "r,X" (1.0e+01));
270 // CHECK: call i32 asm "foo $1,$0", "=r|r,r|X[[CLOBBERS]](double {{[0-9.eE+-]+}})
271 asm("foo %1,%0" : "=r,r" (out0
) : "r,X" (1.0));
277 register int out0
= 0;
278 // Constraint converted differently on different platforms moved to platform-specific.
279 // : call i32 asm "foo $1,$0", "=r|r,r|im[[CLOBBERS]](ptr getelementptr inbounds ([2 x i32], ptr {{[a-zA-Z0-9@%]+}}, {{i[0-9]*}} 0, {{i[0-9]*}} 0))
280 asm("foo %1,%0" : "=r,r" (out0
) : "r,p" (marray
));