| 1 |
/* { dg-set-target-env-var OMP_ALLOCATOR "omp_cgroup_mem_alloc" } */ |
| 2 |
/* { dg-set-target-env-var OMP_DISPLAY_ENV "true" } */ |
| 3 |
|
| 4 |
#include <string.h> |
| 5 |
#include <stdlib.h> |
| 6 |
#include <omp.h> |
| 7 |
|
| 8 |
int |
| 9 |
main () |
| 10 |
{ |
| 11 |
const char *p = getenv ("OMP_ALLOCATOR"); |
| 12 |
if (p && strcmp (p, "omp_cgroup_mem_alloc") == 0) |
| 13 |
{ |
| 14 |
if (omp_get_default_allocator () != omp_cgroup_mem_alloc) |
| 15 |
abort (); |
| 16 |
#pragma omp parallel num_threads (2) |
| 17 |
{ |
| 18 |
if (omp_get_default_allocator () != omp_cgroup_mem_alloc) |
| 19 |
abort (); |
| 20 |
#pragma omp parallel num_threads (2) |
| 21 |
{ |
| 22 |
if (omp_get_default_allocator () != omp_cgroup_mem_alloc) |
| 23 |
abort (); |
| 24 |
} |
| 25 |
} |
| 26 |
} |
| 27 |
return 0; |
| 28 |
} |