blob: 9e6e40ac54df006714e922c2c589bf5fc3291ccc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
/* { dg-do run } */
/* { dg-options "-O3" } */
typedef unsigned int myint __attribute__((aligned(1)));
typedef struct S {
unsigned a, b, c;
} SS;
typedef SS __attribute__((aligned(1))) SSS;
static unsigned int __attribute__ ((noinline))
get_a (SS s)
{
return s.a;
};
static int __attribute__ ((noinline, noclone))
foo (SSS *p)
{
int r = (int) get_a(*p) + 2;
return r;
}
char buf[512];
static SSS * __attribute__ ((noinline, noclone))
get_sss (void)
{
return (SSS *)(buf + 1);
}
int
main(int argc, char *argv[])
{
SSS *p = get_sss();
if (foo(p) != 2)
__builtin_abort ();
return 0;
}
|