Skip to content

Commit 41da687

Browse files
committed
[NFC][OpenMP] Update a test that was failing on aarch64.
The failure was reported here: llvm#164039 (comment) The test is checking for the "bad" behavior so as to keep track of it. It could just be updated to check the "good" behavior and marked as XFAIL, but then it would not be as informative. The update for now is to fix the pointer arithmetic. If that isn't sufficient, we can fall back to doing the above.
1 parent c3d905e commit 41da687

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

offload/test/mapping/use_device_addr/target_data_use_device_addr_class_member_ref_with_map.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ struct ST {
1616
int m = 0;
1717

1818
void f6() {
19-
uintptr_t offset = (uintptr_t)&d - n;
19+
intptr_t offset = (uintptr_t)&d - n;
2020
#pragma omp target data map(to : m, d)
2121
{
2222
void *mapped_ptr = omp_get_mapped_ptr(&d, omp_get_default_device());
@@ -34,10 +34,11 @@ struct ST {
3434
// ref/attach modifiers:
3535
// &ref_ptee(this[0].[d])), &ref_ptee(this[0].d), TO | FROM
3636
// &ref_ptr(this[0].d), &ref_ptee(this[0].d), 4, ATTACH
37-
// EXPECTED: 1 0
38-
// CHECK: 0 1
39-
printf("%d %d\n", &d == mapped_ptr,
40-
(uintptr_t)&d == (uintptr_t)mapped_ptr - offset);
37+
// EXPECTED: 1 0
38+
// CHECK-NEXT: 0 1
39+
intptr_t offset_device = (intptr_t)mapped_ptr - (intptr_t)&d;
40+
printf("%d %d\n", &d == mapped_ptr, offset == offset_device);
41+
printf("%lu %ld\n", offset, offset_device);
4142
}
4243
}
4344
}

0 commit comments

Comments
 (0)