]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/testsuite/gcc.dg/Warray-parameter-8.c
Update copyright years.
[thirdparty/gcc.git] / gcc / testsuite / gcc.dg / Warray-parameter-8.c
CommitLineData
e808f3fd
MS
1/* Verify that combinations of array type qualifiers render correctly.
2 { dg-do compile }
3 { dg-options "-Warray-parameter" } */
4
5void fatm (int[_Atomic 1]); // { dg-message "previously declared as 'int\\\[_Atomic 1]" }
6void fatm (int[_Atomic 2]); // { dg-warning "argument 1 of type 'int\\\[_Atomic 2]' with mismatched bound" }
7
8
9void fcst (int[const 2]); // { dg-message "previously declared as 'int\\\[const 2]" }
10void fcst (int[const 3]); // { dg-warning "argument 1 of type 'int\\\[const 3]' with mismatched bound" }
11
12
13void frst (int[restrict 3]); // { dg-message "previously declared as 'int\\\[restrict 3]" }
14void frst (int[restrict 4]); // { dg-warning "argument 1 of type 'int\\\[restrict 4]' with mismatched bound" }
15
16void fvol (int[volatile 4]); // { dg-message "previously declared as 'int\\\[volatile 4]" }
17void fvol (int[volatile 5]); // { dg-warning "argument 1 of type 'int\\\[volatile 5]' with mismatched bound" }
18
19
20void fcr (int[const restrict 1]); // { dg-message "previously declared as 'int\\\[\(const restrict|restrict const\) 1]" }
21void fcr (int[restrict volatile 2]); // { dg-warning "argument 1 of type 'int\\\[\(restrict volatile|volatile restrict\) 2]' with mismatched bound" }
22void fcr (int[const restrict volatile 3]); // { dg-warning "argument 1 of type 'int\\\[const volatile restrict 3]' with mismatched bound" }
23
24
25extern int n;
26
27void fcx_n (int [const 1][n]); // { dg-message "previously declared as 'int\\\[const 1]\\\[n]'" "note" }
28void fcx_n (int [restrict 2][n]); // { dg-warning "argument 1 of type 'int\\\[restrict 2]\\\[n]' with mismatched bound" }
29
30
31extern int n1, n2;
32
33/* The mismatch in the array bound should be diagnosed but the mismatch
34 in the VLA should not be without -Wvla-parameter. */
35void fc3_n1 (int [const 3][n1]); // { dg-message "previously declared as 'int\\\[const 3]\\\[n1]'" "note" }
36void fc3_n1 (int [const 5][n2]); // { dg-warning "argument 1 of type 'int\\\[const 5]\\\[n2]' with mismatched bound" }