blob: dc07e0d092b5f3608f68f8bfea496726abdc19a0 [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.
Chris Lattner17e681f2009-04-15 07:03:57 +00004// RUN: clang-cc %s -Wno-extra-tokens 2>&1 | not grep diagnostic &&
Chris Lattner27ceb9d2009-04-15 07:01:18 +00005
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
Chris Lattner3fbbfcf2009-04-15 07:05:12 +000012// Mapping unrelated diags to errors doesn't affect this one.
13// RUN: clang-cc %s -Werror=trigraphs 2>&1 | grep "warning:" &&
14
Chris Lattner27ceb9d2009-04-15 07:01:18 +000015// This should stay a warning with -pedantic.
16// RUN: clang-cc %s -pedantic 2>&1 | grep "warning:" &&
17
18// This should emit an error with -pedantic-errors.
19// RUN: clang-cc %s -pedantic-errors 2>&1 | grep "error:" &&
20
21// This should emit a warning, because -Wfoo overrides -pedantic*.
Chris Lattner92af2102009-04-15 07:02:57 +000022// RUN: clang-cc %s -pedantic-errors -Wextra-tokens 2>&1 | grep "warning:" &&
Chris Lattner27ceb9d2009-04-15 07:01:18 +000023
24// This should emit nothing, because -Wno-extra-tokens overrides -pedantic*
25// RUN: clang-cc %s -pedantic-errors -Wno-extra-tokens 2>&1 | not grep diagnostic
26
27#ifdef foo
28#endif bad // extension!
29
30int x;