[PATCH] D146618: [ExecutionEngine] Fix R_AARCH64_ABS{16, 32} assertion
Denis Revunov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 5 09:01:26 PDT 2023
treapster added a comment.
@MaskRay
#include <iostream>
#include <cstdint>
#define INT32_MIN (-2147483647-1)
#define UINT32_MAX (4294967295U)
int main() {
uint64_t Result = -4ull;
std::cout << "Original: " <<
(static_cast<int64_t>(Result) >= INT32_MIN && Result < UINT32_MAX) << "\n";
std::cout << "Less or equal: " <<
(static_cast<int64_t>(Result) >= INT32_MIN && Result <= UINT32_MAX) << "\n";
std::cout << "With cast: " <<
(static_cast<int64_t>(Result) >= INT32_MIN &&
static_cast<int64_t>(Result) <= UINT32_MAX) << "\n";
}
Results in
Original: 0
Less or equal: 0
With cast: 1
We need both `<=` and cast.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D146618/new/
https://reviews.llvm.org/D146618
More information about the llvm-commits
mailing list