]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/g++.dg/gomp/critical-3.C
* builtin-types.def (BT_FN_VOID_BOOL, BT_FN_VOID_SIZE_SIZE_PTR,
[thirdparty/gcc.git] / gcc / testsuite / g++.dg / gomp / critical-3.C
1 int i;
2
3 template <int N>
4 void
5 foo (void)
6 {
7 #pragma omp critical (foo), hint (N + 1)
8 i++;
9 }
10
11 template <int N>
12 void
13 bar (void)
14 {
15 #pragma omp critical (bar), hint (N + i) // { dg-error "constant integer expression" }
16 i++;
17 }
18
19 template <typename T>
20 void
21 baz (T x)
22 {
23 #pragma omp critical (baz) hint (x) // { dg-error "expression must be integral" }
24 i++;
25 }
26
27 void
28 test ()
29 {
30 foo <0> ();
31 bar <0> ();
32 baz (0.0);
33 }