summaryrefslogtreecommitdiffstats
path: root/clang/test/Frontend/compiler-options-dump.cpp
diff options
context:
space:
mode:
authorAaron Ballman <aaron@aaronballman.com>2018-05-31 13:57:09 +0000
committerAaron Ballman <aaron@aaronballman.com>2018-05-31 13:57:09 +0000
commit16ed8dd823a4c2282425d081e1817d9dc205775e (patch)
tree010f16011621b4b3d51b0408ea6e0c7b5c521d01 /clang/test/Frontend/compiler-options-dump.cpp
parentd657c2564980cb4ad763c49bf5181c1311824085 (diff)
downloadbcm5719-llvm-16ed8dd823a4c2282425d081e1817d9dc205775e.tar.gz
bcm5719-llvm-16ed8dd823a4c2282425d081e1817d9dc205775e.zip
Add a new driver mode to dump compiler feature and extension options.
Add the ability to dump compiler option-related information to a JSON file via the -compiler-options-dump option. Specifically, it dumps the features/extensions lists -- however, this output could be extended to other information should it be useful. In order to support features and extensions, I moved them into a .def file so that we could build the various lists we care about from them without a significant increase in maintenance burden. llvm-svn: 333653
Diffstat (limited to 'clang/test/Frontend/compiler-options-dump.cpp')
-rw-r--r--clang/test/Frontend/compiler-options-dump.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/clang/test/Frontend/compiler-options-dump.cpp b/clang/test/Frontend/compiler-options-dump.cpp
new file mode 100644
index 00000000000..daa8bb18549
--- /dev/null
+++ b/clang/test/Frontend/compiler-options-dump.cpp
@@ -0,0 +1,25 @@
+// RUN: %clang_cc1 -compiler-options-dump -std=c++03 %s -o - | FileCheck %s --check-prefix=CXX03
+// RUN: %clang_cc1 -compiler-options-dump -std=c++17 %s -o - | FileCheck %s --check-prefix=CXX17
+// RUN: %clang_cc1 -compiler-options-dump -std=c99 -x c %s -o - | FileCheck %s --check-prefix=C99
+
+// CXX03: "features"
+// CXX03: "cxx_auto_type" : false
+// CXX03: "cxx_range_for" : false
+// CXX03: "extensions"
+// CXX03: "cxx_range_for" : true
+
+// CXX17: "features"
+// CXX17: "cxx_auto_type" : true
+// CXX17: "cxx_range_for" : true
+// CXX17: "extensions"
+// CXX17: "cxx_range_for" : true
+
+// C99: "features"
+// C99: "c_alignas" : false
+// C99: "c_atomic" : false
+// C99: "cxx_auto_type" : false
+// C99: "cxx_range_for" : false
+// C99: "extensions"
+// C99: "c_alignas" : true
+// C99: "c_atomic" : true
+// C99: "cxx_range_for" : false
OpenPOWER on IntegriCloud