PR middle-end/77674
[official-gcc.git] / gcc / testsuite / c-c++-common / fmax-errors.c
blobb44e2386ae566360aa89fb1d7a569b28a3dd5c5b
1 /* PR c/44782 */
2 /* { dg-do compile } */
3 /* { dg-options "-fmax-errors=3 -Wall" } */
5 void foo (unsigned int i, unsigned int j)
7 (i) (); /* { dg-error "" } */
8 (j) (); /* { dg-error "" } */
10 i + j; /* { dg-warning "" } */
12 (k) (); /* { dg-error "" } */
13 /* Make sure we see the notes related to the final error we emit. */
14 /* { dg-message "identifier" "" { target c } 12 } */
16 /* Warnings after the final error should not appear. */
17 i + j; /* no warning. */
19 (i*j) (); /* no error here due to -fmax-errors */
21 } /* { dg-prune-output "compilation terminated" } */