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

Subversion Repositories openrisc

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

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

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

powered by: WebSVN 2.1.0

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