diff options
author | Yaxun (Sam) Liu <yaxun.liu@amd.com> | 2022-05-17 15:12:03 -0400 |
---|---|---|
committer | Yaxun (Sam) Liu <yaxun.liu@amd.com> | 2022-05-19 11:34:42 -0400 |
commit | cefe472c51fbcd1aed4d4a090709f25a12a8bc2c (patch) | |
tree | 48abef7e526cf511a39a7fa6ee4a9d7acfab82d6 /clang/unittests/CodeGen/CheckTargetFeaturesTest.cpp | |
parent | 3ed9f603fd59cafe3ab864d8bb77349ed418d384 (diff) | |
download | llvm-cefe472c51fbcd1aed4d4a090709f25a12a8bc2c.zip llvm-cefe472c51fbcd1aed4d4a090709f25a12a8bc2c.tar.gz llvm-cefe472c51fbcd1aed4d4a090709f25a12a8bc2c.tar.bz2 |
[clang] Fix __has_builtin
Fix __has_builtin to return 1 only if the requested target features
of a builtin are enabled by refactoring the code for checking
required target features of a builtin and use it in evaluation
of __has_builtin.
Reviewed by: Artem Belevich
Differential Revision: https://reviews.llvm.org/D125829
Diffstat (limited to 'clang/unittests/CodeGen/CheckTargetFeaturesTest.cpp')
-rw-r--r-- | clang/unittests/CodeGen/CheckTargetFeaturesTest.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/unittests/CodeGen/CheckTargetFeaturesTest.cpp b/clang/unittests/CodeGen/CheckTargetFeaturesTest.cpp index 160b387..b234ca6 100644 --- a/clang/unittests/CodeGen/CheckTargetFeaturesTest.cpp +++ b/clang/unittests/CodeGen/CheckTargetFeaturesTest.cpp @@ -1,4 +1,4 @@ -#include "../lib/CodeGen/CodeGenFunction.h" +#include "../lib/Basic/BuiltinTargetFeatures.h" #include "gtest/gtest.h" using namespace llvm; @@ -11,7 +11,7 @@ TEST(CheckTargetFeaturesTest, checkBuiltinFeatures) { StringMap<bool> SM; for (StringRef F : Features) SM.insert(std::make_pair(F, true)); - clang::CodeGen::TargetFeatures TF(SM); + clang::Builtin::TargetFeatures TF(SM); return TF.hasRequiredFeatures(BuiltinFeatures); }; // Make sure the basic function ',' and '|' works correctly |