Mercurial > hg > CbC > CbC_gcc
view gcc/testsuite/gcc.dg/nested-func-9.c @ 158:494b0b89df80 default tip
...
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 25 May 2020 18:13:55 +0900 |
parents | 04ced10e8804 |
children |
line wrap: on
line source
/* 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); }