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
c++: Fix get_member_function_from_ptrfunc with -fsanitize=bounds [PR116449]
[official-gcc.git]
/
libgomp
/
testsuite
/
libgomp.c++
/
target-lambda-2.C
blob
1d3561ffbd79d51d2411cd89b03bfa89924106e4
1
#include <cstdlib>
2
3
#define N 10
4
int main (void)
5
{
6
int X, Y;
7
#pragma omp target map(from: X, Y)
8
{
9
int x = 0, y = 0;
10
11
for (int i = 0; i < N; i++)
12
[&] (int v) { x += v; } (i);
13
14
auto yinc = [&y] { y++; };
15
for (int i = 0; i < N; i++)
16
yinc ();
17
18
X = x;
19
Y = y;
20
}
21
22
int Xs = 0;
23
for (int i = 0; i < N; i++)
24
Xs += i;
25
if (X != Xs)
26
abort ();
27
28
if (Y != N)
29
abort ();
30
}