Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / Misc / diag-mapping2.c
blob6914307ff978c74e540c2a30caa7fa3f400e6b1b
1 // This should warn by default.
2 // RUN: %clang_cc1 %s 2>&1 | grep "warning: foo"
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 // RUN: %clang_cc1 %s -Wno-cpp 2>&1 | not grep diagnostic
9 // -Werror can map all warnings to error.
10 // RUN: not %clang_cc1 %s -Werror 2>&1 | grep "error: foo"
12 // -Werror can map this one warning to error.
13 // RUN: not %clang_cc1 %s -Werror=#warnings 2>&1 | grep "error: foo"
14 // RUN: not %clang_cc1 %s -Werror=#warnings -W#warnings 2>&1 | grep "error: foo"
16 // -Wno-error= overrides -Werror. -Wno-error applies to a subsequent warning of the same name.
17 // RUN: %clang_cc1 %s -Werror -Wno-error=#warnings 2>&1 | grep "warning: foo"
18 // RUN: %clang_cc1 %s -Werror -Wno-error=#warnings -W#warnings 2>&1 | grep "warning: foo"
20 // -Wno-error overrides -Werror. PR4715
21 // RUN: %clang_cc1 %s -Werror -Wno-error 2>&1 | grep "warning: foo"
23 #warning foo