Loop iteration var with threadprivate is predetermined as threadprivate.
Current clang emit error when loop var that appear in threadprivate
directives.
According to OpenMP 5.1 [2.21.1.1]
For first predetermined rule is: Variables that appear in threadprivate directives or variables with the _Thread_local (in C) or thread_local (in C++) storage-class specifier are threadprivate
The error should not be emitted.
To fix this, add two line condition to check OMPC_threadprivate for the loops.
Need to fix the formatting.