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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [struct-ret-1.c] - Blame information for rev 774

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

Line No. Rev Author Line
1 689 jeremybenn
/* { dg-do run { target hppa*-*-* } } */
2
/* { dg-options { -O2 } { target hppa*-*-* } } */
3
extern void abort (void);
4
extern void exit (int);
5
typedef struct {
6
        int             x;
7
        int             y;
8
}               point_t;
9
 
10
int main(int argc, char *argv[]);
11
int printPoints(point_t a, point_t b);
12
point_t toPoint(int x1, int y1);
13
 
14
int
15
main(int argc, char *argv[])
16
{
17
 
18
        if (printPoints(toPoint(0, 0), toPoint(1000, 1000)) != 1)
19
                abort();
20
        else
21
                exit(0);
22
 
23
        return 0;
24
}
25
 
26
int
27
printPoints(point_t a, point_t b)
28
{
29
        if (a.x != 0
30
            || a.y != 0
31
            || b.x != 1000
32
            || b.y != 1000)
33
                return 0;
34
        else
35
                return 1;
36
}
37
 
38
point_t
39
toPoint(int x1, int y1)
40
{
41
        point_t         p;
42
 
43
        p.x = x1;
44
        p.y = y1;
45
 
46
        return p;
47
}

powered by: WebSVN 2.1.0

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