Debian Codegraph @

clang/test/Misc/diag-mapping.c

raw
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 // RUN: %clang_cc1 %s -pedantic -Wno-error=extra-tokens 2>&1 | grep "warning:"
22
23 // This should emit a warning, because -Wfoo overrides -pedantic*.
24 // RUN: %clang_cc1 %s -pedantic-errors -Wextra-tokens 2>&1 | grep "warning:"
25
26 // This should emit nothing, because -Wno-extra-tokens overrides -pedantic*
27 // RUN: %clang_cc1 %s -pedantic-errors -Wno-extra-tokens 2>&1 | not grep diagnostic
28
29 // -Wno-error=extra-tokens should downgrade -pedantic-errors to warning.
30 // RUN: %clang_cc1 %s -pedantic-errors -Wno-error=extra-tokens 2>&1 | grep "warning:"
31
32 #ifdef foo
33 #endif bad // extension!
34
35 int x;