"Fossies" - the Fresh Open Source Software Archive

Member "cfe-9.0.0.src/test/OpenMP/target_teams_distribute_parallel_for_if_messages.cpp" (16 Jul 2019, 9517 Bytes) of package /linux/misc/cfe-9.0.0.src.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "target_teams_distribute_parallel_for_if_messages.cpp": 8.0.1_vs_9.0.0.

    1 // RUN: %clang_cc1 -verify -fopenmp -fopenmp-version=45 -ferror-limit 100 %s -Wuninitialized
    2 
    3 // RUN: %clang_cc1 -verify -fopenmp-simd -fopenmp-version=45 -ferror-limit 100 %s -Wuninitialized
    4 
    5 void foo() {
    6 }
    7 
    8 bool foobool(int argc) {
    9   return argc;
   10 }
   11 
   12 void xxx(int argc) {
   13   int cond; // expected-note {{initialize the variable 'cond' to silence this warning}}
   14 #pragma omp target teams distribute parallel for if(cond) // expected-warning {{variable 'cond' is uninitialized when used here}}
   15   for (int i = 0; i < 10; ++i)
   16     ;
   17 }
   18 
   19 struct S1; // expected-note {{declared here}}
   20 
   21 template <class T, class S> // expected-note {{declared here}}
   22 int tmain(T argc, S **argv) {
   23   T i, z;
   24 #pragma omp target teams distribute parallel for if // expected-error {{expected '(' after 'if'}}
   25   for (i = 0; i < argc; ++i) foo();
   26 #pragma omp target teams distribute parallel for if ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
   27   for (i = 0; i < argc; ++i) foo();
   28 #pragma omp target teams distribute parallel for if () // expected-error {{expected expression}}
   29   for (i = 0; i < argc; ++i) foo();
   30 #pragma omp target teams distribute parallel for if (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
   31   for (i = 0; i < argc; ++i) foo();
   32 #pragma omp target teams distribute parallel for if (argc)) // expected-warning {{extra tokens at the end of '#pragma omp target teams distribute parallel for' are ignored}}
   33   for (i = 0; i < argc; ++i) foo();
   34 #pragma omp target teams distribute parallel for if (argc > 0 ? argv[1] : argv[2])
   35   for (i = 0; i < argc; ++i) foo();
   36 #pragma omp target teams distribute parallel for if (foobool(argc)), if (true) // expected-error {{directive '#pragma omp target teams distribute parallel for' cannot contain more than one 'if' clause}}
   37   for (i = 0; i < argc; ++i) foo();
   38 #pragma omp target teams distribute parallel for if (S) // expected-error {{'S' does not refer to a value}}
   39   for (i = 0; i < argc; ++i) foo();
   40 #pragma omp target teams distribute parallel for if (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
   41   for (i = 0; i < argc; ++i) foo();
   42 #pragma omp target teams distribute parallel for if (argc argc) // expected-error {{expected ')'}} expected-note {{to match this '('}}
   43   for (i = 0; i < argc; ++i) foo();
   44 #pragma omp target teams distribute parallel for if(argc -z)
   45   for (i = 0; i < argc; ++i) foo();
   46 #pragma omp target teams distribute parallel for if(parallel // expected-error {{use of undeclared identifier 'parallel'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
   47   for (i = 0; i < argc; ++i) foo();
   48 #pragma omp target teams distribute parallel for if(parallel : // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
   49   for (i = 0; i < argc; ++i) foo();
   50 #pragma omp target teams distribute parallel for if(parallel : argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
   51   for (i = 0; i < argc; ++i) foo();
   52 #pragma omp target teams distribute parallel for if(parallel : argc)
   53   for (i = 0; i < argc; ++i) foo();
   54 #pragma omp target teams distribute parallel for if(parallel : argc) if (for:argc) // expected-error {{directive name modifier 'for' is not allowed for '#pragma omp target teams distribute parallel for'}}
   55   for (i = 0; i < argc; ++i) foo();
   56 #pragma omp target teams distribute parallel for if(parallel : argc) if (parallel:argc) // expected-error {{directive '#pragma omp target teams distribute parallel for' cannot contain more than one 'if' clause with 'parallel' name modifier}}
   57   for (i = 0; i < argc; ++i) foo();
   58 #pragma omp target teams distribute parallel for if(target : argc) if (target:argc) // expected-error {{directive '#pragma omp target teams distribute parallel for' cannot contain more than one 'if' clause with 'target' name modifier}}
   59   for (i = 0; i < argc; ++i) foo();
   60 #pragma omp target teams distribute parallel for if(parallel : argc) if (argc) // expected-error {{expected  'target' directive name modifier}} expected-note {{previous clause with directive name modifier specified here}}
   61   for (i = 0; i < argc; ++i) foo();
   62 #pragma omp target teams distribute parallel for if(target: argc) if (argc) // expected-error {{expected  'parallel' directive name modifier}} expected-note {{previous clause with directive name modifier specified here}}
   63   for (i = 0; i < argc; ++i) foo();
   64 #pragma omp target teams distribute parallel for if(distribute : argc) // expected-error {{directive name modifier 'distribute' is not allowed for '#pragma omp target teams distribute parallel for'}}
   65   for (i = 0; i < argc; ++i) foo();
   66 
   67   return 0;
   68 }
   69 
   70 int main(int argc, char **argv) {
   71   int i, z;
   72 #pragma omp target teams distribute parallel for if // expected-error {{expected '(' after 'if'}}
   73   for (i = 0; i < argc; ++i) foo();
   74 #pragma omp target teams distribute parallel for if ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
   75   for (i = 0; i < argc; ++i) foo();
   76 #pragma omp target teams distribute parallel for if () // expected-error {{expected expression}}
   77   for (i = 0; i < argc; ++i) foo();
   78 #pragma omp target teams distribute parallel for if (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
   79   for (i = 0; i < argc; ++i) foo();
   80 #pragma omp target teams distribute parallel for if (argc)) // expected-warning {{extra tokens at the end of '#pragma omp target teams distribute parallel for' are ignored}}
   81   for (i = 0; i < argc; ++i) foo();
   82 #pragma omp target teams distribute parallel for if (argc > 0 ? argv[1] : argv[2])
   83   for (i = 0; i < argc; ++i) foo();
   84 #pragma omp target teams distribute parallel for if (foobool(argc)), if (true) // expected-error {{directive '#pragma omp target teams distribute parallel for' cannot contain more than one 'if' clause}}
   85   for (i = 0; i < argc; ++i) foo();
   86 #pragma omp target teams distribute parallel for if (S1) // expected-error {{'S1' does not refer to a value}}
   87   for (i = 0; i < argc; ++i) foo();
   88 #pragma omp target teams distribute parallel for if (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
   89   for (i = 0; i < argc; ++i) foo();
   90 #pragma omp target teams distribute parallel for if (argc argc) // expected-error {{expected ')'}} expected-note {{to match this '('}}
   91   for (i = 0; i < argc; ++i) foo();
   92 #pragma omp target teams distribute parallel for if (1 0) // expected-error {{expected ')'}} expected-note {{to match this '('}}
   93   for (i = 0; i < argc; ++i) foo();
   94 #pragma omp target teams distribute parallel for if(if(tmain(argc, argv) // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
   95   for (i = 0; i < argc; ++i) foo();
   96 #pragma omp target teams distribute parallel for if(parallel // expected-error {{use of undeclared identifier 'parallel'}} expected-error {{expected ')'}} expected-note {{to match this '('}}
   97   for (i = 0; i < argc; ++i) foo();
   98 #pragma omp target teams distribute parallel for if(parallel : // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
   99   for (i = 0; i < argc; ++i) foo();
  100 #pragma omp target teams distribute parallel for if(parallel : argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
  101   for (i = 0; i < argc; ++i) foo();
  102 #pragma omp target teams distribute parallel for if(parallel : argc / z)
  103   for (i = 0; i < argc; ++i) foo();
  104 #pragma omp target teams distribute parallel for if(parallel : argc) if (for:argc) // expected-error {{directive name modifier 'for' is not allowed for '#pragma omp target teams distribute parallel for'}}
  105   for (i = 0; i < argc; ++i) foo();
  106 #pragma omp target teams distribute parallel for if(parallel : argc) if (parallel:argc) // expected-error {{directive '#pragma omp target teams distribute parallel for' cannot contain more than one 'if' clause with 'parallel' name modifier}}
  107   for (i = 0; i < argc; ++i) foo();
  108 #pragma omp target teams distribute parallel for if(target: argc) if (target:argc) // expected-error {{directive '#pragma omp target teams distribute parallel for' cannot contain more than one 'if' clause with 'target' name modifier}}
  109   for (i = 0; i < argc; ++i) foo();
  110 #pragma omp target teams distribute parallel for if(parallel : argc) if (argc) // expected-note {{previous clause with directive name modifier specified here}} expected-error {{expected  'target' directive name modifier}}
  111   for (i = 0; i < argc; ++i) foo();
  112 #pragma omp target teams distribute parallel for if(target: argc) if (argc) // expected-note {{previous clause with directive name modifier specified here}} expected-error {{expected  'parallel' directive name modifier}}
  113   for (i = 0; i < argc; ++i) foo();
  114 #pragma omp target teams distribute parallel for if(distribute : argc) // expected-error {{directive name modifier 'distribute' is not allowed for '#pragma omp target teams distribute parallel for'}}
  115   for (i = 0; i < argc; ++i) foo();
  116 #pragma omp target teams distribute parallel for default(none) if(argc+argv[0][0]) // expected-error {{variable 'argv' must have explicitly specified data sharing attributes}} expected-error {{variable 'argc' must have explicitly specified data sharing attributes}} expected-note 2 {{explicit data sharing attribute requested here}}
  117   for (i = 0; i < argc; ++i) foo();
  118 
  119   return tmain(argc, argv);
  120 }