Skip analyzer strndup test on hppa*-*-hpux*
[official-gcc.git] / gcc / testsuite / gcc.dg / Wvla-parameter-6.c
blob268aeec92518afa4e83b4c4c9db042e38c940406
1 /* PR middle-end/97189 - ICE on redeclaration of a function with VLA argument
2 and attribute access
3 Also verify the right arguments are underlined in the notes.
4 { dg-do compile }
5 { dg-options "-Wall -fdiagnostics-show-caret" } */
7 #define RW(...) __attribute__ ((access (read_write, __VA_ARGS__)))
9 RW (2, 3) void f1 (int n, int[n], int);
10 /* { dg-warning "attribute 'access \\(read_write, 2, 3\\)' positional argument 2 conflicts with previous designation by argument 3" "warning" { target *-*-* } .-1 }
11 { dg-begin-multiline-output "" }
12 RW (2, 3) void f1 (int n, int[n], int);
14 { dg-end-multiline-output "" }
15 { dg-message "designating the bound of variable length array argument 2" "note" { target *-*-* } .-6 }
16 { dg-begin-multiline-output "" }
17 RW (2, 3) void f1 (int n, int[n], int);
18 ~~~~^ ~~~~~~
19 { dg-end-multiline-output "" } */
22 RW (2) void f2 (int, int[*], int);
23 /* { dg-message "previously declared as a variable length array 'int\\\[\\\*]'" "note" { target *-*-* } .-1 }
24 { dg-begin-multiline-output "" }
25 RW (2, 3) void f2 (int, int[], int);
26 ^~~~~
27 { dg-end-multiline-output "" } */
29 RW (2, 3) void f2 (int, int[], int);
30 /* { dg-warning "argument 2 of type 'int\\\[]' declared as an ordinary array" "warning" { target *-*-* } .-1 }
31 { dg-begin-multiline-output "" }
32 RW (2) void f2 (int, int[*], int);
33 ^~~~~~
34 { dg-end-multiline-output "" } */