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 target/64358
[official-gcc.git]
/
libgomp
/
testsuite
/
libgomp.c
/
target-9.c
blob
00fe0cb170298fb0d9b975093991eede77a9bc31
1
/* { dg-do run } */
2
/* { dg-options "-O1" } */
3
/* { dg-additional-options "-flto" { target lto } } */
4
5
#include <stdlib.h>
6
7
#define N 123456
8
9
#pragma omp declare target
10
int
X
,
Y
;
11
#pragma omp end declare target
12
13
void
14
foo
()
15
{
16
#pragma omp target map(alloc: X)
17
X
=
N
;
18
}
19
20
int
21
main
()
22
{
23
int
res
;
24
25
foo
();
26
27
#pragma omp target map(alloc: X, Y) map(from: res)
28
{
29
Y
=
N
;
30
res
=
X
+
Y
;
31
}
32
33
if
(
res
!=
N
+
N
)
34
abort
();
35
36
return
0
;
37
}