repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
PR rtl-optimization/81424
[official-gcc.git]
/
libgomp
/
testsuite
/
libgomp.oacc-c-c++-common
/
declare-4.c
blob
36bf0ebdd0b3ced4e3efaf229db97727392572da
1
/* { dg-do run { target openacc_nvidia_accel_selected } } */
2
3
#include <stdlib.h>
4
#include <openacc.h>
5
6
float
b
;
7
#pragma acc declare create (b)
8
9
#pragma acc routine
10
int
11
func
(
int
a
)
12
{
13
b
=
a
+
1
;
14
15
return
b
;
16
}
17
18
int
19
main
(
int
argc
,
char
**
argv
)
20
{
21
float
a
;
22
23
a
=
2.0
;
24
25
#pragma acc parallel copy (a)
26
{
27
b
=
a
;
28
a
=
1.0
;
29
a
=
a
+
b
;
30
}
31
32
if
(
a
!=
3.0
)
33
abort
();
34
35
a
=
func
(
a
);
36
37
if
(
a
!=
4.0
)
38
abort
();
39
40
return
0
;
41
}