llvm-project/clang/test/Frontend/compiler-options-dump.cpp
Aaron Ballman 16ed8dd823 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
2018-05-31 13:57:09 +00:00

26 lines
827 B
C++

// 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