commit 912280612a54370fb154224164cccf24b95d1129 parent 2cba9e1b69528c16908d8cd28854211a604cd45b Author: Roberto E. Vargas Caballero <k0ga@shike2.com> Date: Wed, 22 Jun 2022 18:31:20 +0200 tests/cc: Add 0209-flexible.c Diffstat:
A | tests/cc/execute/0209-flexible.c | | | 17 | +++++++++++++++++ |
M | tests/cc/execute/scc-tests.lst | | | 1 | + |
2 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/tests/cc/execute/0209-flexible.c b/tests/cc/execute/0209-flexible.c @@ -0,0 +1,17 @@ +struct str { + int a; + char v[]; +}; + +int +main(void) +{ + struct str *p; + int ary[20]; + + p = (struct str *) ary; + p->a = 2; + p->v[0] = 1; + + return !(p->a + p->v[0] == 3); +} diff --git a/tests/cc/execute/scc-tests.lst b/tests/cc/execute/scc-tests.lst @@ -199,3 +199,4 @@ 0206-initializer.c 0207-structcb.c 0208-sizeof.c +0209-flexible.c