summaryrefslogtreecommitdiff
path: root/libgomp/testsuite/libgomp.c++/loop-7.C
blob: 4eccb7fca01f640959dba8baf922bbe2bb80dd70 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// PR c++/24502
// { dg-do run }

extern "C" void abort ();

template <typename T> T
foo (T r)
{
  T i;
#pragma omp for
  for (i = 0; i < 10; i++)
    r += i;
  return r;
}

int
main ()
{
  if (foo (0) != 10 * 9 / 2 || foo (2L) != 10L * 9 / 2 + 2)
    abort ();
  return 0;
}