aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/c-c++-common/goacc/routine-nohost-2.c
blob: d9acb805d2da716015096a8d0d0fc0a34e17ca11 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
/* Test OpenACC 'routine' with 'nohost' clause, invalid use.  */

#pragma acc routine /* { dg-note {\.\.\. without 'nohost' clause near to here} } */
int THREE_1(void)
{
  return 3;
}

#pragma acc routine (THREE_1) \
  nohost /* { dg-error {incompatible 'nohost' clause when applying '#pragma acc routine' to '[^']*THREE_1[^']*', which has already been marked with an OpenACC 'routine' directive} } */

#pragma acc routine \
  nohost /* { dg-error {incompatible 'nohost' clause when applying '#pragma acc routine' to '[^']*THREE_1[^']*', which has already been marked with an OpenACC 'routine' directive} } */
extern int THREE_1(void);


#pragma acc routine /* { dg-note {\.\.\. without 'nohost' clause near to here} } */
extern void NOTHING_1(void);

#pragma acc routine (NOTHING_1) \
  nohost /* { dg-error {incompatible 'nohost' clause when applying '#pragma acc routine' to '[^']*NOTHING_1[^']*', which has already been marked with an OpenACC 'routine' directive} } */

void NOTHING_1(void)
{
}

#pragma acc routine \
  nohost /* { dg-error {incompatible 'nohost' clause when applying '#pragma acc routine' to '[^']*NOTHING_1[^']*', which has already been marked with an OpenACC 'routine' directive} } */
extern void NOTHING_1(void);

#pragma acc routine (NOTHING_1) \
  nohost /* { dg-error {incompatible 'nohost' clause when applying '#pragma acc routine' to '[^']*NOTHING_1[^']*', which has already been marked with an OpenACC 'routine' directive} } */


extern float ADD_1(float, float);

#pragma acc routine (ADD_1) /* { dg-note {\.\.\. without 'nohost' clause near to here} } */

float ADD_1(float x, float y)
{
  return x + y;
}

#pragma acc routine \
  nohost /* { dg-error {incompatible 'nohost' clause when applying '#pragma acc routine' to '[^']*ADD_1[^']*', which has already been marked with an OpenACC 'routine' directive} } */
extern float ADD_1(float, float);

#pragma acc routine (ADD_1) \
  nohost /* { dg-error {incompatible 'nohost' clause when applying '#pragma acc routine' to '[^']*ADD_1[^']*', which has already been marked with an OpenACC 'routine' directive} } */


/* The same again, but with/without nohost reversed.  */

#pragma acc routine \
  nohost /* { dg-note {\.\.\. with 'nohost' clause here} } */
int THREE_2(void)
{
  return 3;
}

#pragma acc routine (THREE_2) /* { dg-error {missing 'nohost' clause when applying '#pragma acc routine' to '[^']*THREE_2[^']*', which has already been marked with an OpenACC 'routine' directive} } */

#pragma acc routine /* { dg-error {missing 'nohost' clause when applying '#pragma acc routine' to '[^']*THREE_2[^']*', which has already been marked with an OpenACC 'routine' directive} } */
extern int THREE_2(void);


#pragma acc routine \
  nohost /* { dg-note {\.\.\. with 'nohost' clause here} } */
extern void NOTHING_2(void);

#pragma acc routine (NOTHING_2) /* { dg-error {missing 'nohost' clause when applying '#pragma acc routine' to '[^']*NOTHING_2[^']*', which has already been marked with an OpenACC 'routine' directive} } */

void NOTHING_2(void)
{
}

#pragma acc routine /* { dg-error {missing 'nohost' clause when applying '#pragma acc routine' to '[^']*NOTHING_2[^']*', which has already been marked with an OpenACC 'routine' directive} } */
extern void NOTHING_2(void);

#pragma acc routine (NOTHING_2) /* { dg-error {missing 'nohost' clause when applying '#pragma acc routine' to '[^']*NOTHING_2[^']*', which has already been marked with an OpenACC 'routine' directive} } */


extern float ADD_2(float, float);

#pragma acc routine (ADD_2) \
  nohost /* { dg-note {\.\.\. with 'nohost' clause here} } */

float ADD_2(float x, float y)
{
  return x + y;
}

#pragma acc routine /* { dg-error {missing 'nohost' clause when applying '#pragma acc routine' to '[^']*ADD_2[^']*', which has already been marked with an OpenACC 'routine' directive} } */
extern float ADD_2(float, float);

#pragma acc routine (ADD_2) /* { dg-error {missing 'nohost' clause when applying '#pragma acc routine' to '[^']*ADD_2[^']*', which has already been marked with an OpenACC 'routine' directive} } */