1  /* OpenACC privatization: compute construct */
       2  
       3  /* { dg-additional-options "-fopt-info-omp-note" } */
       4  /* { dg-additional-options "--param=openacc-privatization=noisy" } for
       5     testing/documenting aspects of that functionality.  */
       6  
       7  /* See also '../../gfortran.dg/goacc/privatization-1-compute.f90'.  */
       8  
       9  /* It's only with Tcl 8.5 (released in 2007) that "the variable 'varName'
      10     passed to 'incr' may be unset, and in that case, it will be set to [...]",
      11     so to maintain compatibility with earlier Tcl releases, we manually
      12     initialize counter variables:
      13     { dg-line l_dummy[variable c_compute 0] }
      14     { dg-message "dummy" "" { target iN-VAl-Id } l_dummy } to avoid
      15     "WARNING: dg-line var l_dummy defined, but not used".  */
      16  
      17  extern int e;
      18  static int s;
      19  int g;
      20  
      21  void
      22  f (int i, int j, int a)
      23  {
      24    extern int ex;
      25    static int st;
      26    int x, y;
      27  #pragma acc parallel private(i, j, a) private (e, s, g) private(ex, st, x, y) /* { dg-line l_compute[incr c_compute] } */
      28        {
      29  	__label__ ll;
      30  	/* Nested scopes fun.  */
      31  	{
      32  	  struct s_ss { int i; } ss;
      33  	  {
      34  	    extern int func (int *, int *, int *);
      35  	    /* Don't know how to effect a 'CONST_DECL' here.  (See Fortran example.)  */
      36  	    /* Don't know how to effect a 'RESULT_DECL' here; only saw this for OpenMP 'lastprivate'.  */
      37  
      38  	    a = func (&i, &j, &a);
      39  	  }
      40  	  ss.i = a;
      41  	  {
      42  	    extern int func2 (int *, int *, int *, int *, int *, int *, int *);
      43  	    extern int ext;
      44  	    static int sta;
      45  	    a = func2 (&e, &s, &g, &ex, &st, &ext, &sta);
      46  	  }
      47  	}
      48  	x = a;
      49  #pragma acc atomic write
      50  	y = a;
      51  	{
      52  	  int xx, yy;
      53  	  xx = a;
      54  #pragma acc atomic write
      55  	  yy = a;
      56  	}
      57  
      58        ll:
      59  	;
      60        }
      61    /* { dg-note {variable 'y' in 'private' clause is candidate for adjusting OpenACC privatization level} "TODO" { xfail *-*-* } l_compute$c_compute }
      62       { dg-note {variable 'y' ought to be adjusted for OpenACC privatization level: 'gang'} "TODO" { xfail *-*-* } l_compute$c_compute } */
      63    /* { dg-note {variable 'x' in 'private' clause isn't candidate for adjusting OpenACC privatization level: not addressable} "TODO" { xfail *-*-* } l_compute$c_compute } */
      64    /* { dg-note {variable 'st' in 'private' clause is candidate for adjusting OpenACC privatization level} "TODO" { xfail *-*-* } l_compute$c_compute }
      65       { dg-note {variable 'st' ought to be adjusted for OpenACC privatization level: 'gang'} "TODO" { xfail *-*-* } l_compute$c_compute } */
      66    /* { dg-note {variable 'ex' in 'private' clause is candidate for adjusting OpenACC privatization level} "TODO" { xfail *-*-* } l_compute$c_compute }
      67       { dg-note {variable 'ex' ought to be adjusted for OpenACC privatization level: 'gang'} "TODO" { xfail *-*-* } l_compute$c_compute } */
      68    /* { dg-note {variable 'g' in 'private' clause is candidate for adjusting OpenACC privatization level} "TODO" { xfail *-*-* } l_compute$c_compute }
      69       { dg-note {variable 'g' ought to be adjusted for OpenACC privatization level: 'gang'} "TODO" { xfail *-*-* } l_compute$c_compute } */
      70    /* { dg-note {variable 's' in 'private' clause is candidate for adjusting OpenACC privatization level} "TODO" { xfail *-*-* } l_compute$c_compute }
      71       { dg-note {variable 's' ought to be adjusted for OpenACC privatization level: 'gang'} "TODO" { xfail *-*-* } l_compute$c_compute } */
      72    /* { dg-note {variable 'e' in 'private' clause is candidate for adjusting OpenACC privatization level} "TODO" { xfail *-*-* } l_compute$c_compute }
      73       { dg-note {variable 'e' ought to be adjusted for OpenACC privatization level: 'gang'} "TODO" { xfail *-*-* } l_compute$c_compute } */
      74    /* { dg-note {variable 'a' in 'private' clause is candidate for adjusting OpenACC privatization level} "TODO" { xfail *-*-* } l_compute$c_compute }
      75       { dg-note {variable 'a' ought to be adjusted for OpenACC privatization level: 'gang'} "TODO" { xfail *-*-* } l_compute$c_compute } */
      76    /* { dg-note {variable 'j' in 'private' clause is candidate for adjusting OpenACC privatization level} "TODO" { xfail *-*-* } l_compute$c_compute }
      77       { dg-note {variable 'j' ought to be adjusted for OpenACC privatization level: 'gang'} "TODO" { xfail *-*-* } l_compute$c_compute } */
      78    /* { dg-note {variable 'i' in 'private' clause is candidate for adjusting OpenACC privatization level} "TODO" { xfail *-*-* } l_compute$c_compute }
      79       { dg-note {variable 'i' ought to be adjusted for OpenACC privatization level: 'gang'} "TODO" { xfail *-*-* } l_compute$c_compute } */
      80    /* { dg-note {variable 'll' declared in block potentially has improper OpenACC privatization level: 'label_decl'} "TODO" { target *-*-* } l_compute$c_compute } */
      81    /* { dg-note {variable 'struct struct s_ss' declared in block potentially has improper OpenACC privatization level: 'type_decl'} "TODO" { target c } l_compute$c_compute }
      82       { dg-note {variable 's_ss' declared in block potentially has improper OpenACC privatization level: 'type_decl'} "TODO" { target c++ } l_compute$c_compute } */
      83    /* { dg-note {variable 'ss' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_compute$c_compute } */
      84    /* { dg-note {variable 'func' declared in block potentially has improper OpenACC privatization level: 'function_decl'} "TODO" { target *-*-* } l_compute$c_compute } */
      85    /* { dg-note {variable 'func2' declared in block potentially has improper OpenACC privatization level: 'function_decl'} "TODO" { target *-*-* } l_compute$c_compute } */
      86    /* { dg-note {variable 'ext' declared in block isn't candidate for adjusting OpenACC privatization level: external} "" { target *-*-* } l_compute$c_compute } */
      87    /* { dg-note {variable 'sta' declared in block isn't candidate for adjusting OpenACC privatization level: static} "" { target *-*-* } l_compute$c_compute } */
      88    /* { dg-note {variable 'xx' declared in block isn't candidate for adjusting OpenACC privatization level: not addressable} "" { target *-*-* } l_compute$c_compute } */
      89    /* { dg-note {variable 'yy' declared in block is candidate for adjusting OpenACC privatization level} "" { target *-*-* } l_compute$c_compute }
      90       { dg-note {variable 'yy' ought to be adjusted for OpenACC privatization level: 'gang'} "" { target *-*-* } l_compute$c_compute } */
      91  }