[Core] Fix parallel_for for Linux
authorJames Henderson <jh7370@my.bristol.ac.uk>
Fri, 7 Apr 2017 08:11:28 +0000 (08:11 +0000)
committerJames Henderson <jh7370@my.bristol.ac.uk>
Fri, 7 Apr 2017 08:11:28 +0000 (08:11 +0000)
commit8abda20a9f23b45d2dca76932cfd1c723db3ee72
tree8e6831c84b3198502a8275366f56f84197951ad8
parent33e0dbcc5872139a6cdd9337244287fb93fc1a96
[Core] Fix parallel_for for Linux

r299635 exposed a latent bug in the Linux implementation of parallel_for, which
resulted in it calling the function outside of the range requested, resulting
later in a segmentation fault. This change fixes this issue and adds a unit test.

llvm-svn: 299748
lld/include/lld/Core/Parallel.h
lld/unittests/CoreTests/ParallelTest.cpp