warning-flags-tree.c 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. // RUN: diagtool tree | FileCheck -strict-whitespace %s
  2. // RUN: diagtool tree -Weverything | FileCheck -strict-whitespace %s
  3. // RUN: diagtool tree everything | FileCheck -strict-whitespace %s
  4. //
  5. // These three ways of running diagtool tree are the same:
  6. // they produce a tree for every top-level diagnostic flag.
  7. // Just check a few to make sure we're actually showing more than one group.
  8. //
  9. // CHECK: -W
  10. // CHECK: -Wextra
  11. // CHECK: -Wmissing-field-initializers
  12. // CHECK: warn_missing_field_initializers
  13. // CHECK: -Wall
  14. // CHECK: -Wmost
  15. // These flags are currently unimplemented; test that we output them anyway.
  16. // CHECK: -Wstrict-aliasing
  17. // CHECK-NEXT: -Wstrict-aliasing=0
  18. // CHECK-NEXT: -Wstrict-aliasing=1
  19. // CHECK-NEXT: -Wstrict-aliasing=2
  20. // CHECK: -Wstrict-overflow
  21. // CHECK-NEXT: -Wstrict-overflow=0
  22. // CHECK-NEXT: -Wstrict-overflow=1
  23. // CHECK-NEXT: -Wstrict-overflow=2
  24. // CHECK-NEXT: -Wstrict-overflow=3
  25. // CHECK-NEXT: -Wstrict-overflow=4
  26. // CHECK-NEXT: -Wstrict-overflow=5
  27. // RUN: not diagtool tree -Wthis-is-not-a-valid-flag
  28. // RUN: diagtool tree -Wgnu | FileCheck -strict-whitespace -check-prefix CHECK-GNU %s
  29. // CHECK-GNU: -Wgnu
  30. // CHECK-GNU: -Wgnu-designator
  31. // CHECK-GNU: ext_gnu_array_range
  32. // CHECK-GNU: ext_gnu_missing_equal_designator
  33. // CHECK-GNU: ext_gnu_old_style_field_designator
  34. // CHECK-GNU: -Wvla-extension
  35. // CHECK-GNU: ext_vla
  36. // There are more GNU extensions but we don't need to check them all.
  37. // RUN: diagtool tree --flags-only -Wgnu | FileCheck -check-prefix CHECK-FLAGS-ONLY %s
  38. // CHECK-FLAGS-ONLY: -Wgnu
  39. // CHECK-FLAGS-ONLY: -Wgnu-designator
  40. // CHECK-FLAGS-ONLY-NOT: ext_gnu_array_range
  41. // CHECK-FLAGS-ONLY-NOT: ext_gnu_missing_equal_designator
  42. // CHECK-FLAGS-ONLY-NOT: ext_gnu_old_style_field_designator
  43. // CHECK-FLAGS-ONLY: -Wvla
  44. // CHECK-FLAGS-ONLY-NOT: ext_vla
  45. // CHECK-FLAGS-ONLY-NOT: ext_array_init_copy
  46. // CHECK-FLAGS-ONLY-NOT: ext_empty_struct_union
  47. // CHECK-FLAGS-ONLY-NOT: ext_expr_not_ice