blob: f6ace02d077b55748319e2141dbc5773930ff9c5 [file] [log] [blame]
Chris Lattner27ceb9d2009-04-15 07:01:18 +00001// This should warn by default.
2// RUN: clang-cc %s 2>&1 | grep "warning:" &&
3// This should not emit anything.
4// RUN: clang-cc %s -Wno-extra-tokens 2>&1 | not grep diagnostic
5
6// -Werror can map all warnings to error.
7// RUN: clang-cc %s -Werror 2>&1 | grep "error:" &&
8
9// -Werror can map this one warning to error.
10// RUN: clang-cc %s -Werror=extra-tokens 2>&1 | grep "error:" &&
11
12// This should stay a warning with -pedantic.
13// RUN: clang-cc %s -pedantic 2>&1 | grep "warning:" &&
14
15// This should emit an error with -pedantic-errors.
16// RUN: clang-cc %s -pedantic-errors 2>&1 | grep "error:" &&
17
18// This should emit a warning, because -Wfoo overrides -pedantic*.
19// RUN: clang-cc %s -pedantic-errors -Wextra_tokens 2>&1 | grep "error:" &&
20
21// This should emit nothing, because -Wno-extra-tokens overrides -pedantic*
22// RUN: clang-cc %s -pedantic-errors -Wno-extra-tokens 2>&1 | not grep diagnostic
23
24#ifdef foo
25#endif bad // extension!
26
27int x;