OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-stable/] [gcc-4.5.1/] [libgomp/] [testsuite/] [libgomp.c++/] [atomic-1.C] - Blame information for rev 859

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 273 jeremybenn
// PR c++/33894
2
// { dg-do run }
3
// { dg-options "-O2" }
4
 
5
extern "C" void abort ();
6
 
7
int check;
8
 
9
template void
10
foo ()
11
{
12
  #pragma omp atomic
13
  check |= sizeof (T);
14
}
15
 
16
template void
17
bar (T *x, T y)
18
{
19
  #pragma omp atomic
20
  *x += y;
21
}
22
 
23
template void
24
baz ()
25
{
26
  #pragma omp atomic
27
  check++;
28
}
29
 
30
int
31
main ()
32
{
33
  int i = 0;
34
  long l = 0;
35
 
36
  check = 0;
37
  foo ();
38
  if (check != sizeof (char))
39
    abort ();
40
  foo ();
41
  if (check != (sizeof (char) | sizeof (short)))
42
    abort ();
43
  bar(&i, 4);
44
  bar(&l, 8L);
45
  if (i != 4 || l != 8L)
46
    abort ();
47
  baz ();
48
  if (check != (sizeof (char) | sizeof (short)) + 1)
49
    abort ();
50
  baz ();
51
  if (check != (sizeof (char) | sizeof (short)) + 2)
52
    abort ();
53
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.