1 // RUN: %clang_cc1 -triple i686 -emit-llvm %s -o - | FileCheck %s
2 // RUN: %clang_cc1 -triple x86_64 -emit-llvm %s -o - | FileCheck %s
13 // CHECK: asm "foo $1,$0", "=R,R[[CLOBBERS:[a-zA-Z0-9@%{},~_ ]*\"]](i32 {{[a-zA-Z0-9@%]+}})
14 asm("foo %1,%0" : "=R" (mout0
) : "R" (min1
));
20 // CHECK: asm "foo $1,$0", "=q,q[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
21 asm("foo %1,%0" : "=q" (mout0
) : "q" (min1
));
27 // CHECK: asm "foo $1,$0", "=Q,Q[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
28 asm("foo %1,%0" : "=Q" (mout0
) : "Q" (min1
));
34 // CHECK: asm "foo $1,$0", "={ax},{ax}[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
35 asm("foo %1,%0" : "=a" (mout0
) : "a" (min1
));
41 // CHECK: asm "foo $1,$0", "={bx},{bx}[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
42 asm("foo %1,%0" : "=b" (mout0
) : "b" (min1
));
48 // CHECK: asm "foo $1,$0", "={cx},{cx}[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
49 asm("foo %1,%0" : "=c" (mout0
) : "c" (min1
));
55 // CHECK: asm "foo $1,$0", "={dx},{dx}[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
56 asm("foo %1,%0" : "=d" (mout0
) : "d" (min1
));
62 // CHECK: asm "foo $1,$0", "={si},{si}[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
63 asm("foo %1,%0" : "=S" (mout0
) : "S" (min1
));
69 // CHECK: asm "foo $1,$0", "={di},{di}[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
70 asm("foo %1,%0" : "=D" (mout0
) : "D" (min1
));
76 // CHECK: asm "foo $1,$0", "=A,A[[CLOBBERS]](i32 {{[a-zA-Z0-9@%]+}})
77 asm("foo %1,%0" : "=A" (mout0
) : "A" (min1
));
83 //FIXME: I don't know how to do an 80387 floating point stack register operation, which I think is fp80.
89 //FIXME: I don't know how to do an 80387 floating point stack register operation, which I think is fp80.
95 //FIXME: I don't know how to do an 80387 floating point stack register operation, which I think is fp80.
101 // CHECK: call double asm "foo $1,$0", "=y,y[[CLOBBERS]](double {{[a-zA-Z0-9@%]+}})
102 asm("foo %1,%0" : "=y" (dout0
) : "y" (din1
));
108 // CHECK: asm "foo $1,$0", "=x,x[[CLOBBERS]](double {{[a-zA-Z0-9@%]+}})
109 asm("foo %1,%0" : "=x" (dout0
) : "x" (din1
));
115 // 'Y' constraint currently broken.
116 //asm("foo %1,%0" : "=Y0" (mout0) : "Y0" (min1));
117 //asm("foo %1,%0" : "=Yz" (mout0) : "Yz" (min1));
118 //asm("foo %1,%0" : "=Yt" (mout0) : "Yt" (min1));
119 //asm("foo %1,%0" : "=Yi" (mout0) : "Yi" (min1));
120 //asm("foo %1,%0" : "=Ym" (mout0) : "Ym" (min1));
126 // CHECK: asm "foo $1,$0", "=*m,I[[CLOBBERS]](ptr elementtype(i32) @mout0, i32 1)
127 asm("foo %1,%0" : "=m" (mout0
) : "I" (1));
133 // CHECK: asm "foo $1,$0", "=*m,J[[CLOBBERS]](ptr elementtype(i32) @mout0, i32 1)
134 asm("foo %1,%0" : "=m" (mout0
) : "J" (1));
140 // CHECK: asm "foo $1,$0", "=*m,K[[CLOBBERS]](ptr elementtype(i32) @mout0, i32 1)
141 asm("foo %1,%0" : "=m" (mout0
) : "K" (1));
147 // CHECK: asm "foo $1,$0", "=*m,L[[CLOBBERS]](ptr elementtype(i32) @mout0, i32 255)
148 asm("foo %1,%0" : "=m" (mout0
) : "L" (0xff));
149 // CHECK: asm "foo $1,$0", "=*m,L[[CLOBBERS]](ptr elementtype(i32) @mout0, i32 65535)
150 asm("foo %1,%0" : "=m" (mout0
) : "L" (0xffff));
151 // CHECK: asm "foo $1,$0", "=*m,L[[CLOBBERS]](ptr elementtype(i32) @mout0, i32 -1)
152 asm("foo %1,%0" : "=m" (mout0
) : "L" (0xffffffff));
158 // CHECK: asm "foo $1,$0", "=*m,M[[CLOBBERS]](ptr elementtype(i32) @mout0, i32 1)
159 asm("foo %1,%0" : "=m" (mout0
) : "M" (1));
165 // CHECK: asm "foo $1,$0", "=*m,N[[CLOBBERS]](ptr elementtype(i32) @mout0, i32 1)
166 asm("foo %1,%0" : "=m" (mout0
) : "N" (1));
172 // CHECK: asm "foo $1,$0", "=*m,G[[CLOBBERS]](ptr elementtype(i32) @mout0, double {{1.[0]+e[+]*[0]+}})
173 asm("foo %1,%0" : "=m" (mout0
) : "G" (1.0));
179 // CHECK: asm "foo $1,$0", "=*m,C[[CLOBBERS]](ptr elementtype(i32) @mout0, double {{1.[0]+e[+]*[0]+}})
180 asm("foo %1,%0" : "=m" (mout0
) : "C" (1.0));
186 // CHECK: asm "foo $1,$0", "=*m,e[[CLOBBERS]](ptr elementtype(i32) @mout0, i32 1)
187 asm("foo %1,%0" : "=m" (mout0
) : "e" (1));
193 // CHECK: asm "foo $1,$0", "=*m,Z[[CLOBBERS]](ptr elementtype(i32) @mout0, i32 1)
194 asm("foo %1,%0" : "=m" (mout0
) : "Z" (1));
200 // CHECK: asm "foo $1,$0", "=*r|R|m,r|R|m[[CLOBBERS]](ptr elementtype(i32) @mout0, i32 {{[a-zA-Z0-9@%]+}})
201 asm("foo %1,%0" : "=r,R,m" (mout0
) : "r,R,m" (min1
));
207 // CHECK: asm "foo $1,$0", "=*r|q|m,r|q|m[[CLOBBERS]](ptr elementtype(i32) @mout0, i32 {{[a-zA-Z0-9@%]+}})
208 asm("foo %1,%0" : "=r,q,m" (mout0
) : "r,q,m" (min1
));
214 // CHECK: asm "foo $1,$0", "=*r|Q|m,r|Q|m[[CLOBBERS]](ptr elementtype(i32) @mout0, i32 {{[a-zA-Z0-9@%]+}})
215 asm("foo %1,%0" : "=r,Q,m" (mout0
) : "r,Q,m" (min1
));
221 // CHECK: asm "foo $1,$0", "=*r|{ax}|m,r|{ax}|m[[CLOBBERS]](ptr elementtype(i32) @mout0, i32 {{[a-zA-Z0-9@%]+}})
222 asm("foo %1,%0" : "=r,a,m" (mout0
) : "r,a,m" (min1
));
228 // CHECK: asm "foo $1,$0", "=*r|{bx}|m,r|{bx}|m[[CLOBBERS]](ptr elementtype(i32) @mout0, i32 {{[a-zA-Z0-9@%]+}})
229 asm("foo %1,%0" : "=r,b,m" (mout0
) : "r,b,m" (min1
));
235 // CHECK: asm "foo $1,$0", "=*r|{cx}|m,r|{cx}|m[[CLOBBERS]](ptr elementtype(i32) @mout0, i32 {{[a-zA-Z0-9@%]+}})
236 asm("foo %1,%0" : "=r,c,m" (mout0
) : "r,c,m" (min1
));
242 // CHECK: asm "foo $1,$0", "=*r|{dx}|m,r|{dx}|m[[CLOBBERS]](ptr elementtype(i32) @mout0, i32 {{[a-zA-Z0-9@%]+}})
243 asm("foo %1,%0" : "=r,d,m" (mout0
) : "r,d,m" (min1
));
249 // CHECK: asm "foo $1,$0", "=*r|{si}|m,r|{si}|m[[CLOBBERS]](ptr elementtype(i32) @mout0, i32 {{[a-zA-Z0-9@%]+}})
250 asm("foo %1,%0" : "=r,S,m" (mout0
) : "r,S,m" (min1
));
256 // CHECK: asm "foo $1,$0", "=*r|{di}|m,r|{di}|m[[CLOBBERS]](ptr elementtype(i32) @mout0, i32 {{[a-zA-Z0-9@%]+}})
257 asm("foo %1,%0" : "=r,D,m" (mout0
) : "r,D,m" (min1
));
263 // CHECK: asm "foo $1,$0", "=*r|A|m,r|A|m[[CLOBBERS]](ptr elementtype(i32) @mout0, i32 {{[a-zA-Z0-9@%]+}})
264 asm("foo %1,%0" : "=r,A,m" (mout0
) : "r,A,m" (min1
));
270 //FIXME: I don't know how to do an 80387 floating point stack register operation, which I think is fp80.
276 //FIXME: I don't know how to do an 80387 floating point stack register operation, which I think is fp80.
282 //FIXME: I don't know how to do an 80387 floating point stack register operation, which I think is fp80.
288 // CHECK: asm "foo $1,$0", "=*r|y|m,r|y|m[[CLOBBERS]](ptr elementtype(double) @dout0, double {{[a-zA-Z0-9@%]+}})
289 asm("foo %1,%0" : "=r,y,m" (dout0
) : "r,y,m" (din1
));
295 // CHECK: asm "foo $1,$0", "=*r|x|m,r|x|m[[CLOBBERS]](ptr elementtype(double) @dout0, double {{[a-zA-Z0-9@%]+}})
296 asm("foo %1,%0" : "=r,x,m" (dout0
) : "r,x,m" (din1
));
302 // Y constraint currently broken.
303 //asm("foo %1,%0" : "=r,Y0,m" (mout0) : "r,Y0,m" (min1));
304 //asm("foo %1,%0" : "=r,Yz,m" (mout0) : "r,Yz,m" (min1));
305 //asm("foo %1,%0" : "=r,Yt,m" (mout0) : "r,Yt,m" (min1));
306 //asm("foo %1,%0" : "=r,Yi,m" (mout0) : "r,Yi,m" (min1));
307 //asm("foo %1,%0" : "=r,Ym,m" (mout0) : "r,Ym,m" (min1));
313 // CHECK: asm "foo $1,$0", "=*r|m|m,r|I|m[[CLOBBERS]](ptr elementtype(i32) @mout0, i32 1)
314 asm("foo %1,%0" : "=r,m,m" (mout0
) : "r,I,m" (1));
320 // CHECK: asm "foo $1,$0", "=*r|m|m,r|J|m[[CLOBBERS]](ptr elementtype(i32) @mout0, i32 1)
321 asm("foo %1,%0" : "=r,m,m" (mout0
) : "r,J,m" (1));
327 // CHECK: asm "foo $1,$0", "=*r|m|m,r|K|m[[CLOBBERS]](ptr elementtype(i32) @mout0, i32 1)
328 asm("foo %1,%0" : "=r,m,m" (mout0
) : "r,K,m" (1));
334 // CHECK: asm "foo $1,$0", "=*r|m|m,r|L|m[[CLOBBERS]](ptr elementtype(i32) @mout0, i32 1)
335 asm("foo %1,%0" : "=r,m,m" (mout0
) : "r,L,m" (1));
341 // CHECK: asm "foo $1,$0", "=*r|m|m,r|M|m[[CLOBBERS]](ptr elementtype(i32) @mout0, i32 1)
342 asm("foo %1,%0" : "=r,m,m" (mout0
) : "r,M,m" (1));
348 // CHECK: asm "foo $1,$0", "=*r|m|m,r|N|m[[CLOBBERS]](ptr elementtype(i32) @mout0, i32 1)
349 asm("foo %1,%0" : "=r,m,m" (mout0
) : "r,N,m" (1));
355 // CHECK: asm "foo $1,$0", "=*r|m|m,r|G|m[[CLOBBERS]](ptr elementtype(i32) @mout0, double {{1.[0]+e[+]*[0]+}})
356 asm("foo %1,%0" : "=r,m,m" (mout0
) : "r,G,m" (1.0));
362 // CHECK: asm "foo $1,$0", "=*r|m|m,r|C|m[[CLOBBERS]](ptr elementtype(i32) @mout0, double {{1.[0]+e[+]*[0]+}})
363 asm("foo %1,%0" : "=r,m,m" (mout0
) : "r,C,m" (1.0));
369 // CHECK: asm "foo $1,$0", "=*r|m|m,r|e|m[[CLOBBERS]](ptr elementtype(i32) @mout0, i32 1)
370 asm("foo %1,%0" : "=r,m,m" (mout0
) : "r,e,m" (1));
376 // CHECK: asm "foo $1,$0", "=*r|m|m,r|Z|m[[CLOBBERS]](ptr elementtype(i32) @mout0, i32 1)
377 asm("foo %1,%0" : "=r,m,m" (mout0
) : "r,Z,m" (1));