blob: 672d0548ad827b2ae44ad8be21124fd8f0f3a386 [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
Chris Lattnerf9150ba2009-04-16 04:32:54 +00007
8// -Werror can map all warnings to error.
Alp Tokerf9fc2dc2014-06-10 06:08:41 +00009// RUN: not %clang_cc1 %s -Werror 2>&1 | grep "error: foo"
Chris Lattnerf9150ba2009-04-16 04:32:54 +000010
11// -Werror can map this one warning to error.
Alp Tokerf9fc2dc2014-06-10 06:08:41 +000012// RUN: not %clang_cc1 %s -Werror=#warnings 2>&1 | grep "error: foo"
Chris Lattnerf9150ba2009-04-16 04:32:54 +000013
14// -Wno-error= overrides -Werror. rdar://3158301
Alp Tokerf9fc2dc2014-06-10 06:08:41 +000015// RUN: %clang_cc1 %s -Werror -Wno-error=#warnings 2>&1 | grep "warning: foo"
Shantonu Sen4a7b9372009-08-14 04:07:15 +000016
17// -Wno-error overrides -Werror. PR4715
Alp Tokerf9fc2dc2014-06-10 06:08:41 +000018// RUN: %clang_cc1 %s -Werror -Wno-error 2>&1 | grep "warning: foo"
Chris Lattnerf9150ba2009-04-16 04:32:54 +000019
20#warning foo
21