[clang][feature] Add cxx_abi_relative_vtable feature

This will be enabled if relative vtables is enabled.

Differential revision: https://reviews.llvm.org/D85924
This commit is contained in:
Leonard Chan 2020-10-08 10:27:47 -07:00
parent 4a1682e931
commit 64c0792946
2 changed files with 15 additions and 0 deletions

View File

@ -256,5 +256,7 @@ EXTENSION(gnu_asm, LangOpts.GNUAsm)
EXTENSION(gnu_asm_goto_with_outputs, LangOpts.GNUAsm)
EXTENSION(matrix_types, LangOpts.MatrixTypes)
FEATURE(cxx_abi_relative_vtable, LangOpts.CPlusPlus && LangOpts.RelativeCXXABIVTables)
#undef EXTENSION
#undef FEATURE

View File

@ -0,0 +1,13 @@
// RUN: %clang_cc1 -E %s -triple x86_64-linux-gnu -x c++ -o - | FileCheck %s --check-prefix=NO-RELATIVE-VTABLE
// RUN: %clang_cc1 -E %s -triple x86_64-linux-gnu -x c++ -fexperimental-relative-c++-abi-vtables -o - | FileCheck %s --check-prefix=RELATIVE-VTABLE
// RUN: %clang_cc1 -E %s -triple x86_64-linux-gnu -x c++ -fno-experimental-relative-c++-abi-vtables -o - | FileCheck %s --check-prefix=NO-RELATIVE-VTABLE
// RUN: %clang_cc1 -E %s -triple x86_64-linux-gnu -x c -fexperimental-relative-c++-abi-vtables -o - | FileCheck %s --check-prefix=NO-RELATIVE-VTABLE
#if __has_feature(cxx_abi_relative_vtable)
int has_relative_vtable();
#else
int has_no_relative_vtable();
#endif
// RELATIVE-VTABLE: has_relative_vtable
// NO-RELATIVE-VTABLE: has_no_relative_vtable