コード例 #1
0
void SAclient(int arg) {
  SA<int,123> s;
  s.func(arg); // expected-note {{in instantiation of member function}}
  double marr[10][10][10];
  double marr2[5][10][1];
  double mvla[5][arg][10];
  double ***mptr;
  const int n = 0;
  const int m = 1;
  double mvla2[5][arg][m+n+10];

  SB *p;

  SD u;
  SC r(p),t(p);
  #pragma omp target teams map(r)
  {}
  #pragma omp target teams map(marr[2][0:2][0:2]) // expected-error {{array section does not specify contiguous storage}}
  {}
  #pragma omp target teams map(marr[:][0:2][0:2]) // expected-error {{array section does not specify contiguous storage}}
  {}
  #pragma omp target teams map(marr[2][3][0:2])
  {}
  #pragma omp target teams map(marr[:][:][:])
  {}
  #pragma omp target teams map(marr[:2][:][:])
  {}
  #pragma omp target teams map(marr[arg:][:][:])
  {}
  #pragma omp target teams map(marr[arg:])
  {}
  #pragma omp target teams map(marr[arg:][:arg][:]) // correct if arg is the size of dimension 2
  {}
  #pragma omp target teams map(marr[:arg][:])
  {}
  #pragma omp target teams map(marr[:arg][n:])
  {}
  #pragma omp target teams map(marr[:][:arg][n:]) // correct if arg is the size of  dimension 2
  {}
  #pragma omp target teams map(marr[:][:m][n:]) // expected-error {{array section does not specify contiguous storage}}
  {}
  #pragma omp target teams map(marr[n:m][:arg][n:])
  {}
  #pragma omp target teams map(marr[:2][:1][:]) // expected-error {{array section does not specify contiguous storage}}
  {}
  #pragma omp target teams map(marr[:2][1:][:]) // expected-error {{array section does not specify contiguous storage}}
  {}
  #pragma omp target teams map(marr[:2][:][:1]) // expected-error {{array section does not specify contiguous storage}}
  {}
  #pragma omp target teams map(marr[:2][:][1:]) // expected-error {{array section does not specify contiguous storage}}
  {}
  #pragma omp target teams map(marr[:1][:2][:])
  {}
  #pragma omp target teams map(marr[:1][0][:])
  {}
  #pragma omp target teams map(marr[:arg][:2][:]) // correct if arg is 1
  {}
  #pragma omp target teams map(marr[:1][3:1][:2])
  {}
  #pragma omp target teams map(marr[:1][3:arg][:2]) // correct if arg is 1
  {}
  #pragma omp target teams map(marr[:1][3:2][:2]) // expected-error {{array section does not specify contiguous storage}}
  {}
  #pragma omp target teams map(marr[:2][:10][:])
  {}
  #pragma omp target teams map(marr[:2][:][:5+5])
  {}
  #pragma omp target teams map(marr[:2][2+2-4:][0:5+5])
  {}

  #pragma omp target teams map(marr[:1][:2][0]) // expected-error {{array section does not specify contiguous storage}}
  {}
  #pragma omp target teams map(marr2[:1][:2][0])
  {}

  #pragma omp target teams map(mvla[:1][:][0]) // correct if the size of dimension 2 is 1.
  {}
  #pragma omp target teams map(mvla[:2][:arg][:]) // correct if arg is the size of dimension 2.
  {}
  #pragma omp target teams map(mvla[:1][:2][0]) // expected-error {{array section does not specify contiguous storage}}
   {}
  #pragma omp target teams map(mvla[1][2:arg][:])
  {}
  #pragma omp target teams map(mvla[:1][:][:])
  {}
  #pragma omp target teams map(mvla2[:1][:2][:11])
  {}
  #pragma omp target teams map(mvla2[:1][:2][:10]) // expected-error {{array section does not specify contiguous storage}}
  {}

  #pragma omp target teams map(mptr[:2][2+2-4:1][0:5+5]) // expected-error {{array section does not specify contiguous storage}}
  {}
  #pragma omp target teams map(mptr[:1][:2-1][2:4-3])
  {}
  #pragma omp target teams map(mptr[:1][:arg][2:4-3]) // correct if arg is 1.
  {}
  #pragma omp target teams map(mptr[:1][:2-1][0:2])
  {}
  #pragma omp target teams map(mptr[:1][:2][0:2]) // expected-error {{array section does not specify contiguous storage}}
  {}
  #pragma omp target teams map(mptr[:1][:][0:2]) // expected-error {{section length is unspecified and cannot be inferred because subscripted value is not an array}}
  {}
  #pragma omp target teams map(mptr[:2][:1][0:2]) // expected-error {{array section does not specify contiguous storage}}
  {}

  #pragma omp target teams map(r.ArrS[0].B)
  {}
  #pragma omp target teams map(r.ArrS[:1].B) // expected-error {{OpenMP array section is not allowed here}}
  {}
  #pragma omp target teams map(r.ArrS[:arg].B) // expected-error {{OpenMP array section is not allowed here}}
  {}
  #pragma omp target teams map(r.ArrS[0].Arr[1:23])
  {}
  #pragma omp target teams map(r.ArrS[0].Arr[1:arg])
  {}
  #pragma omp target teams map(r.ArrS[0].Arr[arg:23])
  {}
  #pragma omp target teams map(r.ArrS[0].Error) // expected-error {{no member named 'Error' in 'SB'}}
  {}
  #pragma omp target teams map(r.ArrS[0].A, r.ArrS[1].A) // expected-error {{multiple array elements associated with the same variable are not allowed in map clauses of the same construct}} expected-note {{used here}}
  {}
  #pragma omp target teams map(r.ArrS[0].A, t.ArrS[1].A)
  {}
  #pragma omp target teams map(r.PtrS[0], r.PtrS->B) // expected-error {{same pointer derreferenced in multiple different ways in map clause expressions}} expected-note {{used here}}
  {}
  #pragma omp target teams map(r.RPtrS[0], r.RPtrS->B) // expected-error {{same pointer derreferenced in multiple different ways in map clause expressions}} expected-note {{used here}}
  {}
  #pragma omp target teams map(r.S.Arr[:12])
  {}
  #pragma omp target teams map(r.S.foo()[:12]) // expected-error {{expected expression containing only member accesses and/or array sections based on named variables}}
  {}
  #pragma omp target teams map(r.C, r.D)
  {}
  #pragma omp target teams map(r.C, r.C) // expected-error {{variable already marked as mapped in current construct}} expected-note {{used here}}
  {}
  #pragma omp target teams map(r.C) map(r.C) // expected-error {{variable already marked as mapped in current construct}} expected-note {{used here}}
  {}
  #pragma omp target teams map(r.C, r.S)  // this would be an error only caught at runtime - Sema would have to make sure there is not way for the missing data between fields to be mapped somewhere else.
  {}
  #pragma omp target teams map(r, r.S)  // expected-error {{variable already marked as mapped in current construct}} expected-note {{used here}}
  {}
  #pragma omp target teams map(r.C, t.C)
  {}
  #pragma omp target teams map(r.A)   // expected-error {{bit fields cannot be used to specify storage in a 'map' clause}}
  {}
  #pragma omp target teams map(r.Arr)
  {}
  #pragma omp target teams map(r.Arr[3:5])
  {}
  #pragma omp target teams map(r.Ptr[3:5])
  {}
  #pragma omp target teams map(r.ArrS[3:5].A)   // expected-error {{OpenMP array section is not allowed here}}
  {}
  #pragma omp target teams map(r.ArrS[3:5].Arr[6:7])   // expected-error {{OpenMP array section is not allowed here}}
  {}
  #pragma omp target teams map(r.ArrS[3].Arr[6:7])
  {}
  #pragma omp target teams map(r.S.Arr[4:5])
  {}
  #pragma omp target teams map(r.S.Ptr[4:5])
  {}
  #pragma omp target teams map(r.S.Ptr[:])  // expected-error {{section length is unspecified and cannot be inferred because subscripted value is not an array}}
  {}
  #pragma omp target teams map((p+1)->A)  // expected-error {{expected expression containing only member accesses and/or array sections based on named variables}}
  {}
  #pragma omp target teams map(u.B)  // expected-error {{mapped storage cannot be derived from a union}}
  {}

  #pragma omp target data map(to: r.C) //expected-note {{used here}}
  {
    #pragma omp target teams map(r.D)  // expected-error {{original storage of expression in data environment is shared but data environment do not fully contain mapped expression storage}}
    {}
  }

  #pragma omp target data map(to: t.Ptr) //expected-note {{used here}}
  {
    #pragma omp target teams map(t.Ptr[:23])  // expected-error {{pointer cannot be mapped along with a section derived from itself}}
    {}
  }

  #pragma omp target data map(to: t.C, t.D)
  {
  #pragma omp target data map(to: t.C)
  {
    #pragma omp target teams map(t.D)
    {}
  }
  }

  #pragma omp target data map(to: t)
  {
  #pragma omp target data map(to: t.C)
  {
    #pragma omp target teams map(t.D)
    {}
  }
  }
}