blob: 633ab6993d0ac63014e54afea16882a94e0cac88 (
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
42
43
44
45
46
47
48
|
/* PR c/70093 */
/* { dg-do run } */
/* { dg-options "" } */
/* { dg-require-effective-target alloca } */
void
foo (int n)
{
struct S { int a[n]; };
struct S
fn (void)
{
struct S s;
s.a[0] = 42;
return s;
}
auto struct S
fn2 (void)
{
return fn ();
}
struct S x;
fn ();
fn2 ();
x = fn ();
if (x.a[0] != 42)
__builtin_abort ();
if (fn ().a[0] != 42)
__builtin_abort ();
__typeof__ (fn ()) *p = &x;
if (p->a[0] != 42)
__builtin_abort ();
if (fn2 ().a[0] != 42)
__builtin_abort ();
}
int
main (void)
{
foo (1);
}
|