Add a test with an empty input range - should do nothing

llvm-svn: 305268
This commit is contained in:
Marshall Clow 2017-06-13 02:28:40 +00:00
parent 6d0f39476a
commit ba2b6c6fae
1 changed files with 6 additions and 0 deletions

View File

@ -122,6 +122,12 @@ void basic_tests()
assert(v[i] == 40 + triangle(i));
}
{
std::vector<int> v, res;
std::transform_exclusive_scan(v.begin(), v.end(), std::back_inserter(res), 40, std::plus<>(), identity<>());
assert(res.empty());
}
// Make sure that the calculations are done using the init typedef
{
std::vector<unsigned char> v(10);