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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [gomp/] [tpl-atomic-2.C] - Blame information for rev 693

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 693 jeremybenn
// { dg-do compile }
2
 
3
struct S { int x; } s;
4
 
5
// Make sure we detect errors on non-type-dependent things
6
// even when the templates are never instantiated.
7
template void f1()
8
{
9
  #pragma omp atomic
10
  s += 1;               // { dg-error "invalid" }
11
}
12
 
13
template void f2(float *f)
14
{
15
  #pragma omp atomic
16
  *f |= 1;              // { dg-error "invalid|evaluation" }
17
}
18
 
19
// Here the rhs is dependent, but not type dependent.
20
template void f3(float *f)
21
{
22
  #pragma omp atomic
23
  *f |= sizeof (T);     // { dg-error "invalid|evaluation" }
24
}
25
 
26
// And the converse, no error here because we're never fed a T.
27
template void f4(T *t)
28
{
29
  #pragma omp atomic
30
  *t += 1;
31
}
32
 
33
// Here we'll let it go, because the rhs is type dependent and
34
// we can't properly instantiate the statement, and we do most
35
// of the semantic analysis concurrent with that.
36
template void f5(float *f)
37
{
38
  #pragma omp atomic
39
  *f |= (T)sizeof(T);   // { dg-error "invalid|evaluation" "" { xfail *-*-* } }
40
}

powered by: WebSVN 2.1.0

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