blob: bc5a0872e7c84e6c5aa7e96f41379e4e8e012b2a [file] [log] [blame]
Chris Lattner2b07d8f2009-04-16 04:32:54 +00001// This should warn by default.
Daniel Dunbara5728872009-12-15 20:14:24 +00002// RUN: %clang_cc1 %s 2>&1 | grep "warning:"
Chris Lattner2b07d8f2009-04-16 04:32:54 +00003
4// This should not emit anything.
Daniel Dunbara5728872009-12-15 20:14:24 +00005// RUN: %clang_cc1 %s -w 2>&1 | not grep diagnostic
6// RUN: %clang_cc1 %s -Wno-#warnings 2>&1 | not grep diagnostic
Chris Lattner2b07d8f2009-04-16 04:32:54 +00007
8// -Werror can map all warnings to error.
Daniel Dunbara5728872009-12-15 20:14:24 +00009// RUN: %clang_cc1 %s -Werror 2>&1 | grep "error:"
Chris Lattner2b07d8f2009-04-16 04:32:54 +000010
11// -Werror can map this one warning to error.
Daniel Dunbara5728872009-12-15 20:14:24 +000012// RUN: %clang_cc1 %s -Werror=#warnings 2>&1 | grep "error:"
Chris Lattner2b07d8f2009-04-16 04:32:54 +000013
14// -Wno-error= overrides -Werror. rdar://3158301
Daniel Dunbara5728872009-12-15 20:14:24 +000015// RUN: %clang_cc1 %s -Werror -Wno-error=#warnings 2>&1 | grep "warning:"
Shantonu Senb1d76bd2009-08-14 04:07:15 +000016
17// -Wno-error overrides -Werror. PR4715
Daniel Dunbara5728872009-12-15 20:14:24 +000018// RUN: %clang_cc1 %s -Werror -Wno-error 2>&1 | grep "warning:"
Chris Lattner2b07d8f2009-04-16 04:32:54 +000019
20#warning foo
21
22