25 lines · c
1// This should warn by default.2// RUN: %clang_cc1 %s 2>&1 | grep "warning: foo"3 4// This should not emit anything.5// RUN: %clang_cc1 %s -w 2>&1 | not grep diagnostic6// RUN: %clang_cc1 %s -Wno-#warnings 2>&1 | not grep diagnostic7// RUN: %clang_cc1 %s -Wno-cpp 2>&1 | not grep diagnostic8 9// -Werror can map all warnings to error.10// RUN: not %clang_cc1 %s -Werror 2>&1 | grep "error: foo"11 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"15 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"19 20// -Wno-error overrides -Werror. PR471521// RUN: %clang_cc1 %s -Werror -Wno-error 2>&1 | grep "warning: foo"22 23#warning foo24 25