cpp: #include <omp.h>\n#include <stdio.h>\n\nint tp;\n#pragma omp threadprivate(tp)\nint var;\n\nint main(){\n  #pragma omp task\n  {\n    #pragma omp task\n    {\n      tp = 1;\n      #pragma omp task\n      {\n      }\n      var = tp;\n    }\n  }\n  return 0;\n}\n
fortran: module DRB128\ninteger :: tp, var\n!$omp threadprivate(tp)\ncontains\nsubroutine foo\n!$omp task\n!$omp task\ntp = 1\n!$omp task\n!$omp end task\nvar = tp\n!$omp end task\n!$omp end task\nend subroutine\nend module program DRB128_tasking_threadprivate2_orig_no\n    use omp_lib\n    use DRB128\n    implicit none\n\n    call foo()\n    print*,var\nend program