1 // RUN: %libomptarget-compilexx-run-and-check-generic
6 // CHECK: before: [[V1:111]] [[V2:222]] [[PX:0x[^ ]+]] [[PY:0x[^ ]+]]
7 // CHECK: lambda: [[V1]] [[V2]] [[PX_TGT:0x[^ ]+]] 0x{{.*}}
8 // CHECK: tgt : [[V2]] [[PX_TGT]] 1
9 // CHECK: out : [[V2]] [[V2]] [[PX]] [[PY]]
11 #pragma omp begin declare target
15 int e
= -1, *f
, g
= -1;
16 #pragma omp end declare target
24 auto lambda
= [&x
, y
]() {
29 printf("lambda: %d %ld %p %p\n", x
[1], y
[1], &x
[0], &y
[0]);
32 printf("before: %d %ld %p %p\n", x
[1], y
[1], &x
[0], &y
[0]);
34 intptr_t xp
= (intptr_t)&x
[0];
35 #pragma omp target firstprivate(xp)
40 g
= (&x
[0] != (int *)xp
);
41 printf("tgt : %d %p %d\n", x
[1], &x
[0], (&x
[0] != (int *)xp
));
43 #pragma omp target update from(a, b, c, d, e, f, g)
44 printf("lambda: %d %ld %p %p\n", a
, b
, c
, d
);
45 printf("tgt : %d %p %d\n", e
, f
, g
);
46 printf("out : %d %ld %p %p\n", x
[1], y
[1], &x
[0], &y
[0]);