[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / clang / test / OpenMP / loop_bind_messages.cpp
blobf7fdf289714328927e126fccdecee6cba75f5cea
1 #ifndef HEADER
2 #define HEADER
3 // RUN: %clang_cc1 -fopenmp -fopenmp-version=50 -verify %s
5 #define NNN 50
6 int aaa[NNN];
8 void parallel_loop() {
9 #pragma omp parallel
11 #pragma omp loop
12 for (int j = 0 ; j < NNN ; j++) {
13 aaa[j] = j*NNN;
18 void teams_loop() {
19 int var1, var2;
21 #pragma omp teams
23 #pragma omp loop bind(teams)
24 for (int j = 0 ; j < NNN ; j++) {
25 aaa[j] = j*NNN;
28 #pragma omp loop bind(teams) collapse(2) private(var1)
29 for (int i = 0 ; i < 3 ; i++) {
30 for (int j = 0 ; j < NNN ; j++) {
31 var1 += aaa[j];
37 void orphan_loop_with_bind() {
38 #pragma omp loop bind(parallel)
39 for (int j = 0 ; j < NNN ; j++) {
40 aaa[j] = j*NNN;
44 void orphan_loop_no_bind() {
45 #pragma omp loop // expected-error{{expected 'bind' clause for 'loop' construct without an enclosing OpenMP construct}}
46 for (int j = 0 ; j < NNN ; j++) {
47 aaa[j] = j*NNN;
51 void teams_loop_reduction() {
52 int total = 0;
54 #pragma omp teams
56 #pragma omp loop bind(teams)
57 for (int j = 0 ; j < NNN ; j++) {
58 aaa[j] = j*NNN;
61 #pragma omp loop bind(teams) reduction(+:total) // expected-error{{'reduction' clause not allowed with '#pragma omp loop bind(teams)'}}
62 for (int j = 0 ; j < NNN ; j++) {
63 total+=aaa[j];
68 int main(int argc, char *argv[]) {
69 parallel_loop();
70 teams_loop();
71 orphan_loop_with_bind();
72 orphan_loop_no_bind();
73 teams_loop_reduction();
76 #endif