mirror of
git://gcc.gnu.org/git/gcc.git
synced 2024-12-30 21:25:32 +08:00
New testcase.
From-SVN: r19734
This commit is contained in:
parent
ae78d2768e
commit
f824910ea1
27
gcc/testsuite/gcc.dg/clobbers.c
Normal file
27
gcc/testsuite/gcc.dg/clobbers.c
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
/* Test asm clobbers on x86. */
|
||||||
|
|
||||||
|
/* { dg-do run { target i?86-*-* } } */
|
||||||
|
|
||||||
|
int main ()
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
__asm__ ("movl $1,%0\n\txorl %%eax,%%eax" : "=r" (i) : : "eax");
|
||||||
|
if (i != 1)
|
||||||
|
abort ();
|
||||||
|
__asm__ ("movl $1,%0\n\txorl %%ebx,%%ebx" : "=r" (i) : : "ebx");
|
||||||
|
if (i != 1)
|
||||||
|
abort ();
|
||||||
|
__asm__ ("movl $1,%0\n\txorl %%ecx,%%ecx" : "=r" (i) : : "ecx");
|
||||||
|
if (i != 1)
|
||||||
|
abort ();
|
||||||
|
__asm__ ("movl $1,%0\n\txorl %%edx,%%edx" : "=r" (i) : : "edx");
|
||||||
|
if (i != 1)
|
||||||
|
abort ();
|
||||||
|
__asm__ ("movl $1,%0\n\txorl %%esi,%%esi" : "=r" (i) : : "esi");
|
||||||
|
if (i != 1)
|
||||||
|
abort ();
|
||||||
|
__asm__ ("movl $1,%0\n\txorl %%edi,%%edi" : "=r" (i) : : "edi");
|
||||||
|
if (i != 1)
|
||||||
|
abort ();
|
||||||
|
return 0;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user