blob: cde90e299a04bc4288ec3c59b8e2fce96e257948 [file] [log] [blame]
Chris Lattner2b07d8f2009-04-16 04:32:54 +00001// This should warn by default.
Daniel Dunbar4fcfde42009-11-08 01:45:36 +00002// RUN: clang-cc %s 2>&1 | grep "warning:"
Chris Lattner2b07d8f2009-04-16 04:32:54 +00003
4// This should not emit anything.
Daniel Dunbar4fcfde42009-11-08 01:45:36 +00005// RUN: clang-cc %s -w 2>&1 | not grep diagnostic
6// RUN: clang-cc %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 Dunbar4fcfde42009-11-08 01:45:36 +00009// RUN: clang-cc %s -Werror 2>&1 | grep "error:"
Chris Lattner2b07d8f2009-04-16 04:32:54 +000010
11// -Werror can map this one warning to error.
Daniel Dunbar4fcfde42009-11-08 01:45:36 +000012// RUN: clang-cc %s -Werror=#warnings 2>&1 | grep "error:"
Chris Lattner2b07d8f2009-04-16 04:32:54 +000013
14// -Wno-error= overrides -Werror. rdar://3158301
Daniel Dunbar4fcfde42009-11-08 01:45:36 +000015// RUN: clang-cc %s -Werror -Wno-error=#warnings 2>&1 | grep "warning:"
Shantonu Senb1d76bd2009-08-14 04:07:15 +000016
17// -Wno-error overrides -Werror. PR4715
18// RUN: clang-cc %s -Werror -Wno-error 2>&1 | grep "warning:"
Chris Lattner2b07d8f2009-04-16 04:32:54 +000019
20#warning foo
21
22