[llvm] [NFC][OpenMP] Update a test that was failing on aarch64. (PR #164456)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 21 10:32:04 PDT 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-offload
Author: Abhinav Gaba (abhinavgaba)
<details>
<summary>Changes</summary>
The failure was reported here:
https://github.com/llvm/llvm-project/pull/164039#issuecomment-3425429556
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.
---
Full diff: https://github.com/llvm/llvm-project/pull/164456.diff
1 Files Affected:
- (modified) offload/test/mapping/use_device_addr/target_data_use_device_addr_class_member_ref_with_map.cpp (+6-5)
``````````diff
diff --git a/offload/test/mapping/use_device_addr/target_data_use_device_addr_class_member_ref_with_map.cpp b/offload/test/mapping/use_device_addr/target_data_use_device_addr_class_member_ref_with_map.cpp
index 5e8769eb3079d..204e1c3407724 100644
--- a/offload/test/mapping/use_device_addr/target_data_use_device_addr_class_member_ref_with_map.cpp
+++ b/offload/test/mapping/use_device_addr/target_data_use_device_addr_class_member_ref_with_map.cpp
@@ -16,7 +16,7 @@ struct ST {
int m = 0;
void f6() {
- uintptr_t offset = (uintptr_t)&d - n;
+ intptr_t offset = (uintptr_t)&d - n;
#pragma omp target data map(to : m, d)
{
void *mapped_ptr = omp_get_mapped_ptr(&d, omp_get_default_device());
@@ -34,10 +34,11 @@ struct ST {
// ref/attach modifiers:
// &ref_ptee(this[0].[d])), &ref_ptee(this[0].d), TO | FROM
// &ref_ptr(this[0].d), &ref_ptee(this[0].d), 4, ATTACH
- // EXPECTED: 1 0
- // CHECK: 0 1
- printf("%d %d\n", &d == mapped_ptr,
- (uintptr_t)&d == (uintptr_t)mapped_ptr - offset);
+ // EXPECTED: 1 0
+ // CHECK-NEXT: 0 1
+ intptr_t offset_device = (intptr_t)mapped_ptr - (intptr_t)&d;
+ printf("%d %d\n", &d == mapped_ptr, offset == offset_device);
+ printf("%lu %ld\n", offset, offset_device);
}
}
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/164456
More information about the llvm-commits
mailing list