mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-30 14:26:10 +00:00

On z/OS int128 is disabled causing one of the cases in `saturate_cast.pass.cpp` to fail. The failure is only in 64-bit mode. In this case `the std::numeric_limits<long long int>::max()` is within `std::numeric_limits<unsigned long int>::min()` and `std::numeric_limits<unsigned long int>::max()` therefore, saturate_cast<unsigned long int>( sBigMax) == LONG_MAX and not ULONG_MAX as original test. In 32-bit, `saturate_cast<unsigned long int>( sBigMax) == ULONG_MAX` like on other platforms where int128 is enabled. This PR is required to pass this test case on z/OS and possibly on other platforms where int128 is not supported/enabled. --------- Co-authored-by: Sean Perry <perry@ca.ibm.com>