[RISCV][VLOPT] Add vector narrowing integer right shift instructions to isSupportedIn...
[llvm-project.git] / offload / test / offloading / bug53727.cpp
blob8ce8b7e9b87c4b3888d726fd04bbf7166d8f697e
1 // RUN: %libomptarget-compilexx-and-run-generic
2 // RUN: %libomptarget-compileoptxx-and-run-generic
4 #include <cassert>
5 #include <iostream>
7 constexpr const int N = 10;
9 struct T {
10 int a;
11 int *p;
14 struct S {
15 int b;
16 T t;
19 int main(int argc, char *argv[]) {
20 S s;
21 s.t.p = new int[N];
22 for (int i = 0; i < N; ++i) {
23 s.t.p[i] = i;
26 #pragma omp target enter data map(to : s, s.t.p[ : N])
28 #pragma omp target
30 for (int i = 0; i < N; ++i) {
31 s.t.p[i] += i;
35 #pragma omp target update from(s.t.p[ : N])
37 for (int i = 0; i < N; ++i) {
38 assert(s.t.p[i] == 2 * i);
39 s.t.p[i] += i;
42 #pragma omp target update to(s.t.p[ : N])
44 #pragma omp target
46 for (int i = 0; i < N; ++i) {
47 s.t.p[i] += i;
51 #pragma omp target exit data map(from : s, s.t.p[ : N])
53 for (int i = 0; i < N; ++i) {
54 assert(s.t.p[i] == 4 * i);
57 return 0;