1 | // This should warn by default. |
2 | // RUN: %clang_cc1 %s 2>&1 | grep "warning:" |
3 | // This should not emit anything. |
4 | // RUN: %clang_cc1 %s -Wno-extra-tokens 2>&1 | not grep diagnostic |
5 | |
6 | // -Werror can map all warnings to error. |
7 | // RUN: not %clang_cc1 %s -Werror 2>&1 | grep "error:" |
8 | |
9 | // -Werror can map this one warning to error. |
10 | // RUN: not %clang_cc1 %s -Werror=extra-tokens 2>&1 | grep "error:" |
11 | |
12 | // Mapping unrelated diags to errors doesn't affect this one. |
13 | // RUN: %clang_cc1 %s -Werror=trigraphs 2>&1 | grep "warning:" |
14 | |
15 | // This should stay a warning with -pedantic. |
16 | // RUN: %clang_cc1 %s -pedantic 2>&1 | grep "warning:" |
17 | |
18 | // This should emit an error with -pedantic-errors. |
19 | // RUN: not %clang_cc1 %s -pedantic-errors 2>&1 | grep "error:" |
20 | |
21 | // This should emit a warning, because -Wfoo overrides -pedantic*. |
22 | // RUN: %clang_cc1 %s -pedantic-errors -Wextra-tokens 2>&1 | grep "warning:" |
23 | |
24 | // This should emit nothing, because -Wno-extra-tokens overrides -pedantic* |
25 | // RUN: %clang_cc1 %s -pedantic-errors -Wno-extra-tokens 2>&1 | not grep diagnostic |
26 | |
27 | #ifdef foo |
28 | #endif bad // extension! |
29 | |
30 | int x; |
31 | |