diff options
author | Joseph Myers <joseph@codesourcery.com> | 2007-09-02 01:11:20 +0100 |
---|---|---|
committer | Joseph Myers <jsm28@gcc.gnu.org> | 2007-09-02 01:11:20 +0100 |
commit | b09869ff41aa77377645d60115d77177acd3a8cd (patch) | |
tree | 24de65c7de3de7f1f82248b440ebe5639bb4788c /gcc/testsuite/gcc.dg/c99-arraydecl-3.c | |
parent | 15dc95cbcc21b31f3b5ae50d6172db3c4f4894b1 (diff) | |
download | gcc-b09869ff41aa77377645d60115d77177acd3a8cd.zip gcc-b09869ff41aa77377645d60115d77177acd3a8cd.tar.gz gcc-b09869ff41aa77377645d60115d77177acd3a8cd.tar.bz2 |
re PR middle-end/33272 (Compiler does not take advantage of restrict)
PR middle-end/33272
* c-decl.c (grokdeclarator): Apply qualifiers to type of parameter
decayed from array.
testsuite:
* gcc.dg/c99-arraydecl-3.c: New test.
From-SVN: r128018
Diffstat (limited to 'gcc/testsuite/gcc.dg/c99-arraydecl-3.c')
-rw-r--r-- | gcc/testsuite/gcc.dg/c99-arraydecl-3.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.dg/c99-arraydecl-3.c b/gcc/testsuite/gcc.dg/c99-arraydecl-3.c new file mode 100644 index 0000000..2ab927d --- /dev/null +++ b/gcc/testsuite/gcc.dg/c99-arraydecl-3.c @@ -0,0 +1,20 @@ +/* Test for C99 forms of array declarator. Test restrict qualifiers + properly applied to type of parameter. */ +/* Origin: Joseph Myers <joseph@codesourcery.com> */ +/* { dg-do compile } */ +/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */ + +void +f0 (int a[restrict]) +{ + int **b = &a; /* { dg-error "discards qualifiers" } */ + int *restrict *c = &a; +} + +void +f1 (a) + int a[restrict]; +{ + int **b = &a; /* { dg-error "discards qualifiers" } */ + int *restrict *c = &a; +} |