summaryrefslogtreecommitdiff
path: root/openmp
diff options
context:
space:
mode:
authorRon Lieberman <ron.lieberman@amd.com>2023-03-08 22:01:22 -0600
committerRon Lieberman <ron.lieberman@amd.com>2023-03-08 22:05:31 -0600
commit8cf85a0cadb033fed3d96aa5283deb4bfbbaf2c8 (patch)
tree6561e4905accbc858541268ed2adb4798e4c7025 /openmp
parent556a811d686ea5242d8c21b95a97b90aa1be7c56 (diff)
downloadllvm-8cf85a0cadb033fed3d96aa5283deb4bfbbaf2c8.tar.gz
Revert "Add map info for dereference pointer."
breaks amdgpu buildbot This reverts commit 0f2f378425821de77e50a0dcb67c4504389a56e8.
Diffstat (limited to 'openmp')
-rw-r--r--openmp/libomptarget/test/mapping/target_derefence_array_pointrs.cpp105
1 files changed, 0 insertions, 105 deletions
diff --git a/openmp/libomptarget/test/mapping/target_derefence_array_pointrs.cpp b/openmp/libomptarget/test/mapping/target_derefence_array_pointrs.cpp
deleted file mode 100644
index 063aeef4face..000000000000
--- a/openmp/libomptarget/test/mapping/target_derefence_array_pointrs.cpp
+++ /dev/null
@@ -1,105 +0,0 @@
-// RUN: %libomptarget-compilexx-generic -fopenmp-version=51
-// RUN: %libomptarget-run-generic 2>&1 \
-// RUN: | %fcheck-generic
-
-#include <stdio.h>
-#include <stdlib.h>
-
-void foo(int **t1d) {
- int ***t2d = &t1d;
- int ****t3d = &t2d;
- *t1d = (int *)malloc(3 * sizeof(int));
- int j, a = 0, b = 0;
-
- for (j = 0; j < 3; j++)
- (*t1d)[j] = 0;
-#pragma omp target map(tofrom : (*t1d)[0 : 3])
- { (*t1d)[1] = 1; }
- // CHECK: 1
- printf("%d\n", (*t1d)[1]);
-#pragma omp target map(tofrom : (**t2d)[0 : 3])
- { (**t2d)[1] = 2; }
- // CHECK: 2
- printf("%d\n", (**t2d)[1]);
-#pragma omp target map(tofrom : (***t3d)[0 : 3])
- { (***t3d)[1] = 3; }
- // CHECK: 3
- printf("%d\n", (***t3d)[1]);
-#pragma omp target map(tofrom : (**t1d))
- { (*t1d)[0] = 4; }
- // CHECK: 4
- printf("%d\n", (*t1d)[0]);
-#pragma omp target map(tofrom : (*(*(t1d + a) + b)))
- { *(*(t1d + a) + b) = 5; }
- // CHECK: 5
- printf("%d\n", *(*(t1d + a) + b));
-}
-
-typedef int(T)[3];
-void bar() {
- T **a;
- int b[2][3];
- int(*p)[3] = b;
- a = &p;
- for (int i = 0; i < 3; i++) {
- (**a)[1] = i;
- }
-#pragma omp target map((**a)[ : 3])
- {
- (**a)[1] = 6;
- // CHECK: 6
- printf("%d\n", (**a)[1]);
- }
-}
-
-struct SSA {
- int i;
- SSA *sa;
- SSA() {
- i = 1;
- sa = this;
- }
-};
-
-void zoo(int **f, SSA *sa) {
- int *t = *f;
- f = (int **)malloc(sa->i * 4 * sizeof(int));
- t = (int *)malloc(sa->i * sizeof(int));
- *(f + sa->i + 1) = t;
- *(sa->sa->i + *(f + sa->i + 1)) = 4;
- printf("%d\n", *(sa->sa->i + *(1 + sa->i + f)));
-#pragma omp target map(sa, *(sa->sa->i + *(1 + sa->i + f)))
- { *(sa->sa->i + *(1 + sa->i + f)) = 7; }
- // CHECK: 7
- printf("%d\n", *(sa->sa->i + *(1 + sa->i + f)));
-}
-
-void xoo() {
- int *x = 0;
- SSA *sa = new SSA();
- zoo(&x, sa);
-}
-
-void yoo(int **x) {
- *x = (int *)malloc(2 * sizeof(int));
-#pragma omp target map(**x)
- {
- **x = 8;
- // CHECK: 8
- printf("%d\n", **x);
- }
-#pragma omp target map(*(*x + 1))
- {
- *(*x + 1) = 9;
- // CHECK: 9
- printf("%d\n", *(*x + 1));
- }
-}
-
-int main() {
- int *data = 0;
- foo(&data);
- bar();
- xoo();
- yoo(&data);
-}