Files
clang-p2996/offload/test/mapping/declare_mapper_nested_default_mappers_1.cpp
jyu2-git a43677c172 Test faild with amd. (#101781)
Add unspport.

This is relate #101101
2024-08-02 17:53:23 -07:00

37 lines
652 B
C++

// RUN: %libomptarget-compilexx-run-and-check-generic
// UNSUPPORTED: amdgcn-amd-amdhsa
extern "C" int printf(const char *, ...);
typedef struct {
int a;
} C;
#pragma omp declare mapper(C s) map(to : s.a)
typedef struct {
int e;
C f;
int h;
} D;
int main() {
D sa[10];
sa[1].e = 111;
sa[1].f.a = 222;
// CHECK: 111 222
printf("%d %d \n", sa[1].e, sa[1].f.a);
#pragma omp target map(tofrom : sa[0 : 2])
{
// CHECK: 111
printf("%d \n", sa[1].e);
sa[0].e = 333;
sa[1].f.a = 444;
// CHECK: 333 444
printf("%d %d \n", sa[0].e, sa[1].f.a);
}
// CHECK: 333 222
printf("%d %d \n", sa[0].e, sa[1].f.a);
}