Debian Codegraph @

clang/test/AST/ByteCode/openmp.cpp

raw
1 // RUN: %clang_cc1 -verify=expected,both -fopenmp -fopenmp-version=60 %s -fexperimental-new-constant-interpreter
2 // RUN: %clang_cc1 -verify=ref,both -fopenmp -fopenmp-version=60 %s
3
4 int 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
14 extern int omp_get_thread_num(void);
15
16 #define N 64
17
18 int 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