]> git.ipfire.org Git - thirdparty/gcc.git/blob - gcc/testsuite/g++.dg/gomp/declare-target-1.C
gcc/
[thirdparty/gcc.git] / gcc / testsuite / g++.dg / gomp / declare-target-1.C
1 // { dg-do compile }
2 // { dg-options "-fopenmp" }
3
4 #pragma omp declare target
5 void f1 (int);
6 void f1 (double);
7 template <typename T>
8 void f2 (T);
9 template<> void f2<int> (int);
10 #pragma omp end declare target
11 void f3 (int);
12 void f4 (int);
13 void f4 (short);
14 template <typename T>
15 void f5 (T);
16 #pragma omp declare target (f3)
17 #pragma omp declare target to (f4) // { dg-error "overloaded function name .f4. in clause .to." }
18 #pragma omp declare target to (f5<int>) // { dg-error "template .f5<int>. in clause .to." }
19 template <int N>
20 void f6 (int)
21 {
22 static int s;
23 #pragma omp declare target (s)
24 }
25 namespace N
26 {
27 namespace M
28 {
29 void f7 (int);
30 }
31 void f8 (long);
32 }
33 void f9 (short);
34 int v;
35 #pragma omp declare target (N::M::f7)
36 #pragma omp declare target to (::N::f8)
37 #pragma omp declare target to (::f9) to (::v)