Debian Codegraph @

gcc/testsuite/g++.dg/goacc/routine-2.C

raw
1 /* Test invalid use of the routine directive. */
2
3 template <typename T>
4 extern T one_d();
5 #pragma acc routine (one_d) /* { dg-error "names a set of overloads" } */
6
7 template <typename T>
8 T
9 one()
10 {
11 return 1;
12 }
13 #pragma acc routine (one) /* { dg-error "names a set of overloads" } */
14
15 int incr (int);
16 float incr (float);
17
18 #pragma acc routine (incr) /* { dg-error "names a set of overloads" } */
19
20
21 int sum (int, int);
22
23 namespace foo {
24 #pragma acc routine (sum)
25 int sub (int, int);
26 }
27
28 #pragma acc routine (foo::sub)
29
30 /* It's strange to apply a routine directive to subset of overloaded
31 functions, but that is permissible in OpenACC 2.x. */
32
33 int decr (int a);
34
35 #pragma acc routine
36 float decr (float a);