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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.c-torture/] [execute/] [980526-2.c] - Blame information for rev 774

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 688 jeremybenn
typedef unsigned int dev_t;
2
typedef unsigned int kdev_t;
3
 
4
static inline kdev_t to_kdev_t(int dev)
5
{
6
        int major, minor;
7
 
8
        if (sizeof(kdev_t) == 16)
9
                return (kdev_t)dev;
10
        major = (dev >> 8);
11
        minor = (dev & 0xff);
12
        return ((( major ) << 22 ) | (  minor )) ;
13
 
14
}
15
 
16
void do_mknod(const char * filename, int mode, kdev_t dev)
17
{
18
        if (dev==0x15800078)
19
                exit(0);
20
        else
21
                abort();
22
}
23
 
24
 
25
char * getname(const char * filename)
26
{
27
        register unsigned int a1,a2,a3,a4,a5,a6,a7,a8,a9;
28
        a1 = (unsigned int)(filename) *5 + 1;
29
        a2 = (unsigned int)(filename) *6 + 2;
30
        a3 = (unsigned int)(filename) *7 + 3;
31
        a4 = (unsigned int)(filename) *8 + 4;
32
        a5 = (unsigned int)(filename) *9 + 5;
33
        a6 = (unsigned int)(filename) *10 + 5;
34
        a7 = (unsigned int)(filename) *11 + 5;
35
        a8 = (unsigned int)(filename) *12 + 5;
36
        a9 = (unsigned int)(filename) *13 + 5;
37
        return (char *)(a1*a2+a3*a4+a5*a6+a7*a8+a9);
38
}
39
 
40
int sys_mknod(const char * filename, int mode, dev_t dev)
41
{
42
        int error;
43
        char * tmp;
44
 
45
        tmp = getname(filename);
46
        error = ((long)( tmp )) ;
47
        do_mknod(tmp,mode,to_kdev_t(dev));
48
        return error;
49
}
50
 
51
int main(void)
52
{
53
        if (sizeof (int) != 4)
54
          exit (0);
55
 
56
        return sys_mknod("test",1,0x12345678);
57
}

powered by: WebSVN 2.1.0

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