aboutsummaryrefslogtreecommitdiff
path: root/libgomp/testsuite/libgomp.oacc-c-c++-common/pr85381-4.c
blob: e1679444172c1343b503329a3eb777d8cb1e1b9f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/* { dg-do run { target openacc_nvidia_accel_selected } }
   { dg-skip-if "" { *-*-* } { "*" } { "-O2" } } */
/* { dg-additional-options "-foffload=-fdump-rtl-mach" } */

#define n 1024

int
main (void)
{
  #pragma acc parallel
  {
    #pragma acc loop worker
    for (int i = 0; i < n; i++)
      ;

    #pragma acc loop worker
    for (int i = 0; i < n; i++)
      ;
  }

  return 0;
}

/* Atm, %ntid.y is broadcast from one loop to the next, so there are 2 bar.syncs
   for that (the other two are there for the same reason as in pr85381-2.c).
   Todo: Recompute %ntid.y instead of broadcasting it. */
/* { dg-final { scan-offload-rtl-dump-times "nvptx_barsync" 4 "mach" } } */