xref: /llvm-project/openmp/runtime/test/env/omp_alloc_env_invalid.c (revision a60bc55c693609e9417419b72754b9984f52acbe)
1*a60bc55cSAndreyChurbanov // RUN: %libomp-compile
2*a60bc55cSAndreyChurbanov // RUN: env OMP_ALLOCATOR=111 %libomp-run 2>&1 | FileCheck %s
3*a60bc55cSAndreyChurbanov // RUN: env OMP_ALLOCATOR=omp_default_mem_alloc_xyz %libomp-run 2>&1 | FileCheck %s
4*a60bc55cSAndreyChurbanov // UNSUPPORTED: gcc
5*a60bc55cSAndreyChurbanov 
6*a60bc55cSAndreyChurbanov // Both invocations of the test should produce (different) warnings:
7*a60bc55cSAndreyChurbanov // OMP: Warning #42: OMP_ALLOCATOR: "111" is an invalid value; ignored.
8*a60bc55cSAndreyChurbanov // OMP: Warning #189: Allocator omp_const_mem_alloc is not available, will use default allocator.
9*a60bc55cSAndreyChurbanov #include <stdio.h>
10*a60bc55cSAndreyChurbanov #include <omp.h>
main()11*a60bc55cSAndreyChurbanov int main() {
12*a60bc55cSAndreyChurbanov   volatile int n = omp_get_max_threads(); // causes library initialization
13*a60bc55cSAndreyChurbanov   return 0;
14*a60bc55cSAndreyChurbanov }
15*a60bc55cSAndreyChurbanov 
16*a60bc55cSAndreyChurbanov // CHECK: {{^OMP: Warning #[0-9]+}}: {{.*$}}
17