This caused test failures with GCC since its initial commit in r336085 (https://reviews.llvm.org/D46533). llvm-svn: 337911
The current implementation always provides the thread-num for the current parallel region. This patch fixes the behavior for ancestor levels >0. Differential Revision: https://reviews.llvm.org/D46533 llvm-svn: 336085