Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / clang / test / OpenMP / parallel_for_proc_bind_messages.cpp
blob3128b9b24558c44d95d281c5b7551aa63284adab
1 // RUN: %clang_cc1 -verify=omp51,expected -fopenmp -ferror-limit 100 -o - %s -Wuninitialized
3 // RUN: %clang_cc1 -verify=omp51,expected -fopenmp-simd -ferror-limit 100 -o - %s -Wuninitialized
5 // RUN: %clang_cc1 -verify=omp50,expected -fopenmp -fopenmp-version=50 -ferror-limit 100 -o - %s -Wuninitialized
7 // RUN: %clang_cc1 -verify=omp50,expected -fopenmp-simd -fopenmp-version=50 -ferror-limit 100 -o - %s -Wuninitialized
10 void foo();
12 int main(int argc, char **argv) {
13 int i;
14 #pragma omp parallel for proc_bind // expected-error {{expected '(' after 'proc_bind'}}
15 for (i = 0; i < argc; ++i)
16 foo();
17 #pragma omp parallel for proc_bind( // omp50-error {{expected 'master', 'close' or 'spread' in OpenMP clause 'proc_bind'}} omp51-error {{expected 'master', 'close', 'spread' or 'primary' in OpenMP clause 'proc_bind'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
18 for (i = 0; i < argc; ++i)
19 foo();
20 #pragma omp parallel for proc_bind() // omp50-error {{expected 'master', 'close' or 'spread' in OpenMP clause 'proc_bind'}} omp51-error {{expected 'master', 'close', 'spread' or 'primary' in OpenMP clause 'proc_bind'}}
21 for (i = 0; i < argc; ++i)
22 foo();
23 #pragma omp parallel for proc_bind(master // expected-error {{expected ')'}} expected-note {{to match this '('}}
24 for (i = 0; i < argc; ++i)
25 foo();
26 #pragma omp parallel for proc_bind(close), proc_bind(spread) // expected-error {{directive '#pragma omp parallel for' cannot contain more than one 'proc_bind' clause}}
27 for (i = 0; i < argc; ++i)
28 foo();
29 #pragma omp parallel for proc_bind(x) // omp50-error {{expected 'master', 'close' or 'spread' in OpenMP clause 'proc_bind'}} omp51-error {{expected 'master', 'close', 'spread' or 'primary' in OpenMP clause 'proc_bind'}}
30 for (i = 0; i < argc; ++i)
31 foo();
33 #pragma omp parallel for proc_bind(master)
34 for (i = 0; i < argc; ++i)
35 foo();
37 #pragma omp parallel proc_bind(close)
38 #pragma omp parallel for proc_bind(spread)
39 for (i = 0; i < argc; ++i)
40 foo();
41 return 0;