46 lines · c
1// RUN: diagtool show-enabled %s | FileCheck %s2//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_char_or_string7// CHECK: warn_condition_is_assignment8// CHECK: warn_null_arg9 10 11// RUN: diagtool show-enabled -Wno-everything -Rno-everything %s | count 012 13 14// RUN: diagtool show-enabled -Wno-everything -Wobjc-root-class %s | FileCheck -check-prefix CHECK-WARN %s15// RUN: diagtool show-enabled -Wno-everything -Werror=objc-root-class %s | FileCheck -check-prefix CHECK-ERROR %s16// RUN: diagtool show-enabled -Wno-everything -Wfatal-errors=objc-root-class %s | FileCheck -check-prefix CHECK-FATAL %s17//18// CHECK-WARN: W warn_objc_root_class_missing [-Wobjc-root-class]19// CHECK-ERROR: E warn_objc_root_class_missing [-Wobjc-root-class]20// CHECK-FATAL: F warn_objc_root_class_missing [-Wobjc-root-class]21 22// RUN: diagtool show-enabled --no-levels -Wno-everything -Wobjc-root-class %s | FileCheck -check-prefix CHECK-NO-LEVELS %s23//24// CHECK-NO-LEVELS-NOT: {{^W }}25// CHECK-NO-LEVELS-NOT: {{^E }}26// CHECK-NO-LEVELS-NOT: {{^F }}27// CHECK-NO-LEVELS: warn_objc_root_class_missing [-Wobjc-root-class]28 29// Test if EnumConversion is a subgroup of -Wconversion. Because no diagnostics30// are grouped directly under -Wenum-conversion, we check for31// -Wimplicit-enum-enum-cast instead (which is itself under -Wenum-conversion).32// RUN: diagtool show-enabled --no-levels -Wno-conversion -Wenum-conversion %s | FileCheck --check-prefix CHECK-ENUM-CONVERSION %s33// RUN: diagtool show-enabled --no-levels %s | FileCheck --check-prefix CHECK-ENUM-CONVERSION %s34// RUN: diagtool show-enabled --no-levels -Wno-conversion %s | FileCheck --check-prefix CHECK-NO-ENUM-CONVERSION %s35//36// CHECK-ENUM-CONVERSION: -Wimplicit-enum-enum-cast37// CHECK-NO-ENUM-CONVERSION-NOT: -Wimplicit-enum-enum-cast38 39// Test if -Wshift-op-parentheses is a subgroup of -Wparentheses40// RUN: diagtool show-enabled --no-levels -Wno-parentheses -Wshift-op-parentheses %s | FileCheck --check-prefix CHECK-SHIFT-OP-PARENTHESES %s41// RUN: diagtool show-enabled --no-levels %s | FileCheck --check-prefix CHECK-SHIFT-OP-PARENTHESES %s42// RUN: diagtool show-enabled --no-levels -Wno-parentheses %s | FileCheck --check-prefix CHECK-NO-SHIFT-OP-PARENTHESES %s43//44// CHECK-SHIFT-OP-PARENTHESES: -Wshift-op-parentheses45// CHECK-NO-SHIFT-OP-PARENTHESES-NOT: -Wshift-op-parentheses46