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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [gcc.target/] [i386/] [clobbers.c] - Blame information for rev 318

Details | Compare with Previous | View Log

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

powered by: WebSVN 2.1.0

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