From 16ed8dd823a4c2282425d081e1817d9dc205775e Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Thu, 31 May 2018 13:57:09 +0000 Subject: 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 --- clang/test/Frontend/compiler-options-dump.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 clang/test/Frontend/compiler-options-dump.cpp (limited to 'clang/test/Frontend') 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 -- cgit v1.2.3