Add some tests to verify that we implement LWG#2837 correctly. No functional change.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294194 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Marshall Clow
2017-02-06 16:03:23 +00:00
parent c3eec461e7
commit 24597f254d
3 changed files with 16 additions and 2 deletions

View File

@@ -128,4 +128,11 @@ int main()
assert((do_test<long, int>(non_cce)));
assert((do_test<int, long long>(non_cce)));
assert((do_test<long long, int>(non_cce)));
// LWG#2837
{
auto res = std::lcm((int64_t)1234, (int32_t)-2147483648);
static_assert( std::is_same<decltype(res), std::common_type<int64_t, int32_t>::type>::value, "");
assert(res == -1324997410816LL);
}
}