diff options
author | mrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-06-29 17:38:10 +0000 |
---|---|---|
committer | mrs <mrs@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-06-29 17:38:10 +0000 |
commit | 7f2fbd3484ee874ef0afa9dd634d51115997d146 (patch) | |
tree | a7f65ca7f5bcd665a8dd321df2c5b769abf41250 /gcc/testsuite/gcc.dg/vla-8.c | |
parent | 96d472f43208bfcbd49ceb204eb8c0e70b030f88 (diff) | |
download | gcc-7f2fbd3484ee874ef0afa9dd634d51115997d146.tar.gz |
* gcc.dg/vla-8.c: Add additional testcases.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@115074 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.dg/vla-8.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/vla-8.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/vla-8.c b/gcc/testsuite/gcc.dg/vla-8.c index a5b8113a73d..e4c6ae4157f 100644 --- a/gcc/testsuite/gcc.dg/vla-8.c +++ b/gcc/testsuite/gcc.dg/vla-8.c @@ -4,3 +4,27 @@ int a; struct s { void (*f)(int (*)[a]); }; + +static int i; +static int new_i() { i++; return i; } +static int bar1(int a[new_i()][new_i()]); + +void foo(int n) { + extern void bar(int i[n][n]); /* Since this isn't a VM type ensure we can have linkage. */ + extern int bar1(int a[new_i()][new_i()]); /* Since this isn't a VM type ensure we can have linkage. */ +} + +void foo1(int n) { + goto A; + void bar(int i[n][n]); /* Not a VM type, as VM arguments don't matter. */ + int bar1(int a[new_i()][new_i()]); /* Not a VM type, as VM arguments don't matter. */ + A: + ; +} + +void foo2(int n) { + goto A; /* { dg-error "jump into scope of identifier with variably modified type" } */ + int (*(*bar2)(void))[n]; + A: + ; +} |