warning-flags-enabled.c 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. // RUN: diagtool show-enabled %s | FileCheck %s
  2. //
  3. // This shows warnings which are on by default.
  4. // We just check a few to make sure it's doing something sensible.
  5. //
  6. // CHECK: ext_unterminated_string
  7. // CHECK: warn_condition_is_assignment
  8. // CHECK: warn_null_arg
  9. // RUN: diagtool show-enabled -Wno-everything %s | count 0
  10. // RUN: diagtool show-enabled -Wno-everything -Wobjc-root-class %s | FileCheck -check-prefix CHECK-WARN %s
  11. // RUN: diagtool show-enabled -Wno-everything -Werror=objc-root-class %s | FileCheck -check-prefix CHECK-ERROR %s
  12. // RUN: diagtool show-enabled -Wno-everything -Wfatal-errors=objc-root-class %s | FileCheck -check-prefix CHECK-FATAL %s
  13. //
  14. // CHECK-WARN: W warn_objc_root_class_missing [-Wobjc-root-class]
  15. // CHECK-ERROR: E warn_objc_root_class_missing [-Wobjc-root-class]
  16. // CHECK-FATAL: F warn_objc_root_class_missing [-Wobjc-root-class]
  17. // RUN: diagtool show-enabled --no-levels -Wno-everything -Wobjc-root-class %s | FileCheck -check-prefix CHECK-NO-LEVELS %s
  18. //
  19. // CHECK-NO-LEVELS-NOT: W
  20. // CHECK-NO-LEVELS-NOT: E
  21. // CHECK-NO-LEVELS-NOT: F
  22. // CHECK-NO-LEVELS: warn_objc_root_class_missing [-Wobjc-root-class]
  23. // Test if EnumConversion is a subgroup of -Wconversion.
  24. // RUN: diagtool show-enabled --no-levels -Wno-conversion -Wenum-conversion %s | FileCheck --check-prefix CHECK-ENUM-CONVERSION %s
  25. // RUN: diagtool show-enabled --no-levels %s | FileCheck --check-prefix CHECK-ENUM-CONVERSION %s
  26. // RUN: diagtool show-enabled --no-levels -Wno-conversion %s | FileCheck --check-prefix CHECK-NO-ENUM-CONVERSION %s
  27. //
  28. // CHECK-ENUM-CONVERSION: -Wenum-conversion
  29. // CHECK-NO-ENUM-CONVERSION-NOT: -Wenum-conversion
  30. // Test if -Wshift-op-parentheses is a subgroup of -Wparentheses
  31. // RUN: diagtool show-enabled --no-levels -Wno-parentheses -Wshift-op-parentheses %s | FileCheck --check-prefix CHECK-SHIFT-OP-PARENTHESES %s
  32. // RUN: diagtool show-enabled --no-levels %s | FileCheck --check-prefix CHECK-SHIFT-OP-PARENTHESES %s
  33. // RUN: diagtool show-enabled --no-levels -Wno-parentheses %s | FileCheck --check-prefix CHECK-NO-SHIFT-OP-PARENTHESES %s
  34. //
  35. // CHECK-SHIFT-OP-PARENTHESES: -Wshift-op-parentheses
  36. // CHECK-NO-SHIFT-OP-PARENTHESES-NOT: -Wshift-op-parentheses