blob: a64e942f20bdc59e4f067ab41544719551c28eab [file] [log] [blame]
Jordan Rosee7427632012-06-24 00:07:45 +00001// 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
16// These flags are currently unimplemented; test that we output them anyway.
17// CHECK: -Wstrict-aliasing
18// CHECK-NEXT: -Wstrict-aliasing=0
19// CHECK-NEXT: -Wstrict-aliasing=1
20// CHECK-NEXT: -Wstrict-aliasing=2
21// CHECK: -Wstrict-overflow
22// CHECK-NEXT: -Wstrict-overflow=0
23// CHECK-NEXT: -Wstrict-overflow=1
24// CHECK-NEXT: -Wstrict-overflow=2
25// CHECK-NEXT: -Wstrict-overflow=3
26// CHECK-NEXT: -Wstrict-overflow=4
27// CHECK-NEXT: -Wstrict-overflow=5
28
29
30// RUN: not diagtool tree -Wthis-is-not-a-valid-flag
31
32
33// RUN: diagtool tree -Wgnu | FileCheck -strict-whitespace -check-prefix CHECK-GNU %s
34// CHECK-GNU: -Wgnu
35// CHECK-GNU: -Wgnu-designator
36// CHECK-GNU: ext_gnu_array_range
37// CHECK-GNU: ext_gnu_missing_equal_designator
38// CHECK-GNU: ext_gnu_old_style_field_designator
39// CHECK-GNU: -Wvla
40// CHECK-GNU: ext_vla
41// CHECK-GNU: ext_array_init_copy
42// CHECK-GNU: ext_empty_struct_union
43// CHECK-GNU: ext_expr_not_ice
44// There are more GNU extensions but we don't need to check them all.
45
46// RUN: diagtool tree --flags-only -Wgnu | FileCheck -check-prefix CHECK-FLAGS-ONLY %s
47// CHECK-FLAGS-ONLY: -Wgnu
48// CHECK-FLAGS-ONLY: -Wgnu-designator
49// CHECK-FLAGS-ONLY-NOT: ext_gnu_array_range
50// CHECK-FLAGS-ONLY-NOT: ext_gnu_missing_equal_designator
51// CHECK-FLAGS-ONLY-NOT: ext_gnu_old_style_field_designator
52// CHECK-FLAGS-ONLY: -Wvla
53// CHECK-FLAGS-ONLY-NOT: ext_vla
54// CHECK-FLAGS-ONLY-NOT: ext_array_init_copy
55// CHECK-FLAGS-ONLY-NOT: ext_empty_struct_union
56// CHECK-FLAGS-ONLY-NOT: ext_expr_not_ice