brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.9 KiB · b1d6211 Raw
82 lines · cpp
1// RUN: %clang_cc1 -verify=expected,ge40 -fopenmp-version=45 -fopenmp -ferror-limit 100 -o - %s -Wuninitialized2// RUN: %clang_cc1 -verify=expected,ge40 -fopenmp-version=50 -fopenmp-simd -ferror-limit 100 -o - %s -Wuninitialized3// RUN: %clang_cc1 -verify=expected,ge40 -fopenmp-version=50 -fopenmp -ferror-limit 100 -o - %s -Wuninitialized4// RUN: %clang_cc1 -verify=expected,ge40 -fopenmp-version=40 -fopenmp -ferror-limit 100 -o - %s -Wuninitialized5// RUN: %clang_cc1 -verify -fopenmp-version=31 -fopenmp -ferror-limit 100 -o - %s -Wuninitialized6// RUN: %clang_cc1 -verify -fopenmp-version=30 -fopenmp -ferror-limit 100 -o - %s -Wuninitialized7// RUN: %clang_cc1 -verify=expected,ge40 -fopenmp -DOMP51 -ferror-limit 100 -o - %s -Wuninitialized8// RUN: %clang_cc1 -verify=expected,ge40 -fopenmp-simd -DOMP51 -ferror-limit 100 -o - %s -Wuninitialized9// RUN: %clang_cc1 -verify=expected,ge40 -fopenmp-version=60 -fopenmp -DOMP60 -ferror-limit 100 -o - %s -Wuninitialized10 11void foo();12 13namespace {14static int y = 0;15}16static int x = 0;17 18int main(int argc, char **argv) {19  const int c = 0;20 21  #pragma omp parallel default // expected-error {{expected '(' after 'default'}}22#pragma omp parallel default(  // expected-error {{expected 'none', 'shared', 'private' or 'firstprivate' in OpenMP clause 'default'}} expected-error {{expected ')'}} expected-note {{to match this '('}}23#pragma omp parallel default() // expected-error {{expected 'none', 'shared', 'private' or 'firstprivate' in OpenMP clause 'default'}}24#pragma omp parallel default(none                     // expected-error {{expected ')'}} expected-note {{to match this '('}}25#pragma omp parallel default(shared), default(shared) // expected-error {{directive '#pragma omp parallel' cannot contain more than one 'default' clause}}26  foo();27 28  #pragma omp parallel default(none) // expected-note {{explicit data sharing attribute requested here}}29  ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}30 31  #pragma omp parallel default(none) // expected-note {{explicit data sharing attribute requested here}}32  #pragma omp parallel default(shared)33  ++argc; // expected-error {{variable 'argc' must have explicitly specified data sharing attributes}}34 35  #pragma omp parallel default(none) // ge40-note {{explicit data sharing attribute requested here}}36  (void)c; // ge40-error {{variable 'c' must have explicitly specified data sharing attributes}}37 38#ifdef OMP5139#pragma omp parallel default(firstprivate) // expected-note 2 {{explicit data sharing attribute requested here}}40  {41    ++x; // expected-error {{variable 'x' must have explicitly specified data sharing attributes}}42    ++y; // expected-error {{variable 'y' must have explicitly specified data sharing attributes}}43  }44#pragma omp parallel default(private) // expected-note 2 {{explicit data sharing attribute requested here}}45  {46    ++x; // expected-error {{variable 'x' must have explicitly specified data sharing attributes}}47    ++y; // expected-error {{variable 'y' must have explicitly specified data sharing attributes}}48  }49#endif50 51#ifdef OMP6052#pragma omp parallel default(shared:) private(x,y) // expected-error {{wrong variable category specified with modifier shared in the default clause}}53  {54    ++x;55    ++y;56  }57#pragma omp parallel default(shared: junk) private(x,y) // expected-error {{wrong variable category specified with modifier shared in the default clause}}58  {59    ++x;60    ++y;61  }62#pragma omp parallel default(firstprivate: junk) private(x,y) // expected-error {{wrong variable category specified with modifier firstprivate in the default clause}}63  {64    ++x;65    ++y;66  }67#pragma omp parallel default(private: allocatable) private(x,y) // expected-error {{wrong variable category specified with modifier private in the default clause}}68  {69    ++x;70    ++y;71  }72#endif73  return 0;74}75 76class A{77  void a() {78    #pragma omp parallel79    a(b); // expected-error {{use of undeclared identifier 'b'}}80 }81};82