Debian Codegraph @

libgomp/testsuite/libgomp.c++/target-flex-2000.C

raw
1 /* Tiny tuple test. */
2
3 #include <tuple>
4
5 #include "target-flex-common.h"
6
7 bool test(int arg)
8 {
9 bool ok;
10 int out;
11 std::tuple tup = {'a', arg, 3.14f};
12 #pragma omp target map(from: ok, out) map(to: tup)
13 {
14 bool inner_ok = true;
15 {
16 VERIFY (std::get<0>(tup) == 'a');
17 out = std::get<1>(tup);
18 }
19 end:
20 ok = inner_ok;
21 }
22 if (!ok)
23 return false;
24 VERIFY_NON_TARGET (out == arg);
25 return true;
26 }
27
28 int main()
29 {
30 volatile int arg = 42u;
31 return test(arg) ? 0 : 1;
32 }