summaryrefslogtreecommitdiffstats
path: root/test/Misc/warning-flags-tree.c
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2012-08-15 20:02:54 +0000
committerdim <dim@FreeBSD.org>2012-08-15 20:02:54 +0000
commit554bcb69c2d785a011a30e7db87a36a87fe7db10 (patch)
tree9abb1a658a297776086f4e0dfa6ca533de02104e /test/Misc/warning-flags-tree.c
parentbb67ca86b31f67faee50bd10c3b036d65751745a (diff)
downloadFreeBSD-src-554bcb69c2d785a011a30e7db87a36a87fe7db10.zip
FreeBSD-src-554bcb69c2d785a011a30e7db87a36a87fe7db10.tar.gz
Vendor import of clang trunk r161861:
http://llvm.org/svn/llvm-project/cfe/trunk@161861
Diffstat (limited to 'test/Misc/warning-flags-tree.c')
-rw-r--r--test/Misc/warning-flags-tree.c56
1 files changed, 56 insertions, 0 deletions
diff --git a/test/Misc/warning-flags-tree.c b/test/Misc/warning-flags-tree.c
new file mode 100644
index 0000000..a64e942
--- /dev/null
+++ b/test/Misc/warning-flags-tree.c
@@ -0,0 +1,56 @@
+// RUN: diagtool tree | FileCheck -strict-whitespace %s
+// RUN: diagtool tree -Weverything | FileCheck -strict-whitespace %s
+// RUN: diagtool tree everything | FileCheck -strict-whitespace %s
+//
+// These three ways of running diagtool tree are the same:
+// they produce a tree for every top-level diagnostic flag.
+// Just check a few to make sure we're actually showing more than one group.
+//
+// CHECK: -W
+// CHECK: -Wextra
+// CHECK: -Wmissing-field-initializers
+// CHECK: warn_missing_field_initializers
+// CHECK: -Wall
+// CHECK: -Wmost
+
+// These flags are currently unimplemented; test that we output them anyway.
+// CHECK: -Wstrict-aliasing
+// CHECK-NEXT: -Wstrict-aliasing=0
+// CHECK-NEXT: -Wstrict-aliasing=1
+// CHECK-NEXT: -Wstrict-aliasing=2
+// CHECK: -Wstrict-overflow
+// CHECK-NEXT: -Wstrict-overflow=0
+// CHECK-NEXT: -Wstrict-overflow=1
+// CHECK-NEXT: -Wstrict-overflow=2
+// CHECK-NEXT: -Wstrict-overflow=3
+// CHECK-NEXT: -Wstrict-overflow=4
+// CHECK-NEXT: -Wstrict-overflow=5
+
+
+// RUN: not diagtool tree -Wthis-is-not-a-valid-flag
+
+
+// RUN: diagtool tree -Wgnu | FileCheck -strict-whitespace -check-prefix CHECK-GNU %s
+// CHECK-GNU: -Wgnu
+// CHECK-GNU: -Wgnu-designator
+// CHECK-GNU: ext_gnu_array_range
+// CHECK-GNU: ext_gnu_missing_equal_designator
+// CHECK-GNU: ext_gnu_old_style_field_designator
+// CHECK-GNU: -Wvla
+// CHECK-GNU: ext_vla
+// CHECK-GNU: ext_array_init_copy
+// CHECK-GNU: ext_empty_struct_union
+// CHECK-GNU: ext_expr_not_ice
+// There are more GNU extensions but we don't need to check them all.
+
+// RUN: diagtool tree --flags-only -Wgnu | FileCheck -check-prefix CHECK-FLAGS-ONLY %s
+// CHECK-FLAGS-ONLY: -Wgnu
+// CHECK-FLAGS-ONLY: -Wgnu-designator
+// CHECK-FLAGS-ONLY-NOT: ext_gnu_array_range
+// CHECK-FLAGS-ONLY-NOT: ext_gnu_missing_equal_designator
+// CHECK-FLAGS-ONLY-NOT: ext_gnu_old_style_field_designator
+// CHECK-FLAGS-ONLY: -Wvla
+// CHECK-FLAGS-ONLY-NOT: ext_vla
+// CHECK-FLAGS-ONLY-NOT: ext_array_init_copy
+// CHECK-FLAGS-ONLY-NOT: ext_empty_struct_union
+// CHECK-FLAGS-ONLY-NOT: ext_expr_not_ice
OpenPOWER on IntegriCloud