OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [gcc.target/] [i386/] [clobbers.c] - Blame information for rev 816

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 149 jeremybenn
/* Test asm clobbers on x86. */
2
 
3
/* { dg-do run { target i?86-*-* x86_64-*-* } } */
4
/* { dg-skip-if "" { ilp32 } { "-fpic" "-fPIC" } { "" } } */
5
 
6
extern void abort (void);
7
 
8
int main ()
9
{
10
        int i;
11
        __asm__ ("movl $1,%0\n\txorl %%eax,%%eax" : "=r" (i) : : "eax");
12
        if (i != 1)
13
                abort ();
14
        /* On darwin you can't call external functions from non-pic code,
15
           however, clobbering ebx isn't valid in pic code. Instead of
16
           disabling the whole test, just disable the ebx clobbering part.  */
17
#if !(defined (__MACH__))
18
        __asm__ ("movl $1,%0\n\txorl %%ebx,%%ebx" : "=r" (i) : : "ebx");
19
        if (i != 1)
20
                abort ();
21
#endif
22
        __asm__ ("movl $1,%0\n\txorl %%ecx,%%ecx" : "=r" (i) : : "ecx");
23
        if (i != 1)
24
                abort ();
25
        __asm__ ("movl $1,%0\n\txorl %%edx,%%edx" : "=r" (i) : : "edx");
26
        if (i != 1)
27
                abort ();
28
        __asm__ ("movl $1,%0\n\txorl %%esi,%%esi" : "=r" (i) : : "esi");
29
        if (i != 1)
30
                abort ();
31
        __asm__ ("movl $1,%0\n\txorl %%edi,%%edi" : "=r" (i) : : "edi");
32
        if (i != 1)
33
                abort ();
34
        return 0;
35
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.