brintos

brintos / llvm-project-archived public Read only

0
0
Text · 740 B · c7cccfd Raw
30 lines · cpp
1// RUN: %clang_cc1 -verify=expected,both -fopenmp -fopenmp-version=60 %s -fexperimental-new-constant-interpreter2// RUN: %clang_cc1 -verify=ref,both      -fopenmp -fopenmp-version=60 %s3 4int test1() {5  int i;6  int &j = i; // both-note {{declared here}}7  float *f;8  // both-note@+2 {{initializer of 'j' is not a constant expression}}9  // both-error@+1 {{integral constant expression}}10  #pragma omp for simd aligned(f:j)11  for (int i = 0; i < 10; ++i);12}13 14extern int omp_get_thread_num(void);15 16#define N 6417 18int test2() {19  int x = 0;20  int result[N] = {0};21 22  #pragma omp parallel loop num_threads(strict: N) severity(warning) message("msg")23  for (int i = 0; i < N; i++) {24    x = omp_get_thread_num();25    result[i] = i + x;26  }27}28 29 30