Dawid Jurczak f54ca1f632 [NFC][Coroutines] Add regression test for heap allocation elision optimization
Recently C++ snippet included in this patch popped up at least twice in different regression contexts:
https://github.com/llvm/llvm-project/issues/56262 and https://reviews.llvm.org/D123300
It appears that Clang users rely on HALO so adding C++ example coming originally from Gor Nishanov to tests
should help in avoiding similar regressions in future.

Differential Revision: https://reviews.llvm.org/D129279
2022-07-11 16:41:05 +02:00

11 lines
229 B
C++

#pragma once
namespace std {
template <class InputIterator, class T>
T accumulate(InputIterator first, InputIterator last, T init) {
for (; first != last; ++first)
init = init + *first;
return init;
}
} // namespace std