blob: c3afea94b3701ca1bcd4c0e6725891df953c7ceb [file] [log] [blame]
Chris Lattnerf9150ba2009-04-16 04:32:54 +00001// This should warn by default.
Alp Tokerf9fc2dc2014-06-10 06:08:41 +00002// RUN: %clang_cc1 %s 2>&1 | grep "warning: foo"
Chris Lattnerf9150ba2009-04-16 04:32:54 +00003
4// This should not emit anything.
Daniel Dunbar8fbe78f2009-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
David Blaikiee16745f2017-06-01 19:08:34 +00007// RUN: %clang_cc1 %s -Wno-cpp 2>&1 | not grep diagnostic
Chris Lattnerf9150ba2009-04-16 04:32:54 +00008
9// -Werror can map all warnings to error.
Alp Tokerf9fc2dc2014-06-10 06:08:41 +000010// RUN: not %clang_cc1 %s -Werror 2>&1 | grep "error: foo"
Chris Lattnerf9150ba2009-04-16 04:32:54 +000011
12// -Werror can map this one warning to error.
Alp Tokerf9fc2dc2014-06-10 06:08:41 +000013// RUN: not %clang_cc1 %s -Werror=#warnings 2>&1 | grep "error: foo"
Chris Lattnerf9150ba2009-04-16 04:32:54 +000014
15// -Wno-error= overrides -Werror. rdar://3158301
Alp Tokerf9fc2dc2014-06-10 06:08:41 +000016// RUN: %clang_cc1 %s -Werror -Wno-error=#warnings 2>&1 | grep "warning: foo"
Shantonu Sen4a7b9372009-08-14 04:07:15 +000017
18// -Wno-error overrides -Werror. PR4715
Alp Tokerf9fc2dc2014-06-10 06:08:41 +000019// RUN: %clang_cc1 %s -Werror -Wno-error 2>&1 | grep "warning: foo"
Chris Lattnerf9150ba2009-04-16 04:32:54 +000020
21#warning foo
22