[BOLT][Test] Fix PointerAuthCFIFixup.cpp build error when AArch64 not enabled - #198444
[BOLT][Test] Fix PointerAuthCFIFixup.cpp build error when AArch64 not enabled#198444wenju-he wants to merge 2 commits into
Conversation
… enabled When AArch64 target isn't in LLVM_TARGETS_TO_BUILD, AARCH64_AVAILABLE is not defined and there is build error: PointerAuthCFIFixup.cpp:133:39: error: use of undeclared identifier 'AArch64'
|
@llvm/pr-subscribers-bolt Author: Wenju He (wenju-he) ChangesWhen AArch64 target isn't in LLVM_TARGETS_TO_BUILD, AARCH64_AVAILABLE is not defined and there is build error: Full diff: https://github.com/llvm/llvm-project/pull/198444.diff 1 Files Affected:
diff --git a/bolt/unittests/Passes/PointerAuthCFIFixup.cpp b/bolt/unittests/Passes/PointerAuthCFIFixup.cpp
index 0d54b31724274..258455daf7da5 100644
--- a/bolt/unittests/Passes/PointerAuthCFIFixup.cpp
+++ b/bolt/unittests/Passes/PointerAuthCFIFixup.cpp
@@ -122,6 +122,7 @@ struct PassTester : public testing::TestWithParam<Triple::ArchType> {
};
} // namespace
+#ifdef AARCH64_AVAILABLE
TEST_P(PassTester, ExampleTest) {
if (GetParam() != Triple::aarch64)
GTEST_SKIP();
@@ -163,7 +164,9 @@ TEST_P(PassTester, ExampleTest) {
EXPECT_EQ(CFILoc.size(), 1u);
EXPECT_EQ(CFILoc[0], 4);
}
+#endif // AARCH64_AVAILABLE
+#ifdef AARCH64_AVAILABLE
TEST_P(PassTester, fillUnknownStateInBBTest) {
/* Check that a if BB starts with unknown RAState, we can fill the unknown
states based on following instructions with known RAStates.
@@ -234,6 +237,7 @@ TEST_P(PassTester, fillUnknownStateInBBTest) {
EXPECT_TRUE(RAState1.has_value());
EXPECT_TRUE(*RAState1);
}
+#endif // AARCH64_AVAILABLE
TEST_P(PassTester, fillUnknownStubs) {
/*
|
|
@wenju-he hello, thanks for the fix, but I would prefer to exclude the entire file in CMakeLists.txt since PointerAuthCFIFixup.cpp only applies to the aarch64 platform. bolt/unittests/Passes/CMakeLists.txt |
Co-authored-by: Alexey Moksyakov <moksyakov.alexey@huawei.com>
done, thanks @yavtuk |
|
Hi! isnt ths trying to solve the same issue as #197464? That one is already approved, and we are waiting for a merge. I only had a quick look at this and see that this is a bit more complicated change. Isn't the linked one sufficient? |
|
thanks @bgergely0, close this PR. |
When AArch64 target isn't in LLVM_TARGETS_TO_BUILD, AARCH64_AVAILABLE is not defined and there is build error:
PointerAuthCFIFixup.cpp:133:39: error: use of undeclared identifier 'AArch64'