1// This should warn by default.
2// RUN: %clang_cc1 %s 2>&1 | grep "warning:"
3
4// This should not emit anything.
5// RUN: %clang_cc1 %s -w 2>&1 | not grep diagnostic
6// RUN: %clang_cc1 %s -Wno-#warnings 2>&1 | not grep diagnostic
7
8// -Werror can map all warnings to error.
9// RUN: %clang_cc1 %s -Werror 2>&1 | grep "error:"
10
11// -Werror can map this one warning to error.
12// RUN: %clang_cc1 %s -Werror=#warnings 2>&1 | grep "error:"
13
14// -Wno-error= overrides -Werror.  rdar://3158301
15// RUN: %clang_cc1 %s -Werror -Wno-error=#warnings 2>&1 | grep "warning:"
16
17// -Wno-error overrides -Werror.  PR4715
18// RUN: %clang_cc1 %s -Werror -Wno-error 2>&1 | grep "warning:"
19
20#warning foo
21
22
23