aboutsummaryrefslogtreecommitdiff
path: root/libgomp/testsuite/libgomp.c++/target-flex-2000.C
blob: 688c014eb9d42d87985555ab7b35196e9ba2d427 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/* Tiny tuple test.  */

#include <tuple>

#include "target-flex-common.h"

bool test(int arg)
{
  bool ok;
  int out;
  std::tuple tup = {'a', arg, 3.14f};
  #pragma omp target map(from: ok, out) map(to: tup)
    {
      bool inner_ok = true;
      {
	VERIFY (std::get<0>(tup) == 'a');
	out = std::get<1>(tup);
      }
      end:
      ok = inner_ok;
    }
  if (!ok)
    return false;
  VERIFY_NON_TARGET (out == arg);
  return true;
}

int main()
{
  volatile int arg = 42u;
  return test(arg) ? 0 : 1;
}