2009-04-15 11:01:18 +04:00
|
|
|
// This should warn by default.
|
2009-12-15 23:14:24 +03:00
|
|
|
// RUN: %clang_cc1 %s 2>&1 | grep "warning:"
|
2009-04-15 11:01:18 +04:00
|
|
|
// This should not emit anything.
|
2009-12-15 23:14:24 +03:00
|
|
|
// RUN: %clang_cc1 %s -Wno-extra-tokens 2>&1 | not grep diagnostic
|
2009-04-15 11:01:18 +04:00
|
|
|
|
|
|
|
// -Werror can map all warnings to error.
|
2009-12-15 23:14:24 +03:00
|
|
|
// RUN: %clang_cc1 %s -Werror 2>&1 | grep "error:"
|
2009-04-15 11:01:18 +04:00
|
|
|
|
|
|
|
// -Werror can map this one warning to error.
|
2009-12-15 23:14:24 +03:00
|
|
|
// RUN: %clang_cc1 %s -Werror=extra-tokens 2>&1 | grep "error:"
|
2009-04-15 11:01:18 +04:00
|
|
|
|
2009-04-15 11:05:12 +04:00
|
|
|
// Mapping unrelated diags to errors doesn't affect this one.
|
2009-12-15 23:14:24 +03:00
|
|
|
// RUN: %clang_cc1 %s -Werror=trigraphs 2>&1 | grep "warning:"
|
2009-04-15 11:05:12 +04:00
|
|
|
|
2009-04-15 11:01:18 +04:00
|
|
|
// This should stay a warning with -pedantic.
|
2009-12-15 23:14:24 +03:00
|
|
|
// RUN: %clang_cc1 %s -pedantic 2>&1 | grep "warning:"
|
2009-04-15 11:01:18 +04:00
|
|
|
|
|
|
|
// This should emit an error with -pedantic-errors.
|
2009-12-15 23:14:24 +03:00
|
|
|
// RUN: %clang_cc1 %s -pedantic-errors 2>&1 | grep "error:"
|
2009-04-15 11:01:18 +04:00
|
|
|
|
|
|
|
// This should emit a warning, because -Wfoo overrides -pedantic*.
|
2009-12-15 23:14:24 +03:00
|
|
|
// RUN: %clang_cc1 %s -pedantic-errors -Wextra-tokens 2>&1 | grep "warning:"
|
2009-04-15 11:01:18 +04:00
|
|
|
|
|
|
|
// This should emit nothing, because -Wno-extra-tokens overrides -pedantic*
|
2009-12-15 23:14:24 +03:00
|
|
|
// RUN: %clang_cc1 %s -pedantic-errors -Wno-extra-tokens 2>&1 | not grep diagnostic
|
2009-04-15 11:01:18 +04:00
|
|
|
|
|
|
|
#ifdef foo
|
|
|
|
#endif bad // extension!
|
|
|
|
|
|
|
|
int x;
|