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
libcpp: Add support for gnu::offset #embed/__has_embed parameter
[official-gcc.git]
/
libgomp
/
testsuite
/
libgomp.oacc-c++
/
declare-1.C
blob
461b77820ef2ea7a09854b0f4c0ea954af80dbf4
1
#include <stdlib.h>
2
3
template<class T>
4
T foo()
5
{
6
T a, b;
7
#pragma acc declare create (a)
8
9
#pragma acc parallel copyout (b)
10
{
11
a = 5;
12
b = a;
13
}
14
15
return b;
16
}
17
18
int
19
main (void)
20
{
21
int rc;
22
23
rc = foo<int>();
24
25
if (rc != 5)
26
abort ();
27
28
return 0;
29
}