
Currently the affinity format string has initial value. When users set the format via OMP_AFFINITY_FORMAT, it will overwrite the format string. However, when copying the format, the tailing null is missing. As a result, if the user format string is shorter than default value, the remaining part in the default value still makes effort. This bug is not exposed because the test case doesn't check the end of a string. It only checks whether given output "contains" the check string. Reviewed By: AndreyChurbanov Differential Revision: https://reviews.llvm.org/D91309
17 lines
405 B
C
17 lines
405 B
C
// RUN: %libomp-compile
|
|
// RUN: env OMP_DISPLAY_AFFINITY=true OMP_AFFINITY_FORMAT='TESTER-ENV: tl:%L tn:%n nt:%N' OMP_NUM_THREADS=8 %libomp-run | %python %S/check.py -c 'CHECK-8' %s
|
|
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <omp.h>
|
|
|
|
int main(int argc, char** argv) {
|
|
#pragma omp parallel
|
|
{ }
|
|
#pragma omp parallel
|
|
{ }
|
|
return 0;
|
|
}
|
|
|
|
// CHECK-8: num_threads=8 TESTER-ENV: tl:1 tn:[0-7] nt:8$
|