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.dg/] [torture/] [stackalign/] [ret-struct-1.c] - Blame information for rev 298

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 298 jeremybenn
/* { dg-do run } */
2
#include "check.h"
3
 
4
#ifndef ALIGNMENT
5
#define ALIGNMENT       64
6
#endif
7
 
8
extern void abort();
9
typedef struct my_struct
10
{
11
        char str[31];
12
} stype ;
13
 
14
stype g_s;
15
 
16
stype __attribute__((noinline))
17
foo (char arg1, char arg2, char arg3)
18
{
19
        stype __attribute__((aligned(ALIGNMENT))) s;
20
        s.str[0] = arg1;
21
        s.str[1] = arg2;
22
        s.str[30] = arg3;
23
        check(&s, ALIGNMENT);
24
        return s;
25
}
26
 
27
int main()
28
{
29
        g_s = foo(1,2,3);
30
 
31
        if (g_s.str[0] != 1 || g_s.str[1] != 2 || g_s.str[30] !=3)
32
          abort();
33
        return 0;
34
}

powered by: WebSVN 2.1.0

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