https://github.com/banach-space created https://github.com/llvm/llvm-project/pull/216963
None From 19004092150d43c8584b0dfbbec8625fe8719877 Mon Sep 17 00:00:00 2001 From: Andrzej Warzynski <[email protected]> Date: Tue, 18 Aug 2026 08:54:12 +0000 Subject: [PATCH] [clang][cir] Fix tests post #210729 --- clang/test/CIR/CodeGen/ptrdiff.c | 12 +++++++----- clang/test/CIR/CodeGen/ptrdiff.cpp | 7 ++++--- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/clang/test/CIR/CodeGen/ptrdiff.c b/clang/test/CIR/CodeGen/ptrdiff.c index e6a754ebc8d4b..cf28cedf0f7ec 100644 --- a/clang/test/CIR/CodeGen/ptrdiff.c +++ b/clang/test/CIR/CodeGen/ptrdiff.c @@ -17,9 +17,10 @@ int addrcmp(const void* a, const void* b) { // LLVM-NOT: sdiv // LLVM: trunc i64 %[[SUB]] to i32 + // TODO: Fix inconsistency with LLVM (ptrtoint vs ptrtoaddr) // OGCG-LABEL: define dso_local i32 @addrcmp( - // OGCG: %[[PTR_A:.*]] = ptrtoint ptr {{.*}} to i64 - // OGCG: %[[PTR_B:.*]] = ptrtoint ptr {{.*}} to i64 + // OGCG: %[[PTR_A:.*]] = ptrtoaddr ptr {{.*}} to i64 + // OGCG: %[[PTR_B:.*]] = ptrtoaddr ptr {{.*}} to i64 // OGCG: %[[SUB:.*]] = sub i64 %[[PTR_A]], %[[PTR_B]] // OGCG-NOT: sdiv // OGCG: trunc i64 %[[SUB]] to i32 @@ -41,11 +42,12 @@ unsigned long long test_ptr_diff(int *a, int* b) { // LLVM: %[[RETLOAD:.*]] = load i64, ptr %[[RETADDR]], align // LLVM: ret i64 %[[RETLOAD]] + // TODO: Fix inconsistency with LLVM (ptrtoint vs ptrtoaddr) // OGCG-LABEL: define dso_local i64 @test_ptr_diff( - // OGCG: %[[IA:.*]] = ptrtoint ptr %{{.*}} to i64 - // OGCG: %[[IB:.*]] = ptrtoint ptr %{{.*}} to i64 + // OGCG: %[[IA:.*]] = ptrtoaddr ptr %{{.*}} to i64 + // OGCG: %[[IB:.*]] = ptrtoaddr ptr %{{.*}} to i64 // OGCG: %[[SUB:.*]] = sub i64 %[[IA]], %[[IB]] // OGCG: %[[Q:.*]] = sdiv exact i64 %[[SUB]], 4 // OGCG: ret i64 %[[Q]] return a - b; -} \ No newline at end of file +} diff --git a/clang/test/CIR/CodeGen/ptrdiff.cpp b/clang/test/CIR/CodeGen/ptrdiff.cpp index 5805349b74879..0d40c563c6403 100644 --- a/clang/test/CIR/CodeGen/ptrdiff.cpp +++ b/clang/test/CIR/CodeGen/ptrdiff.cpp @@ -22,12 +22,13 @@ size_type size(unsigned long *_start, unsigned long *_finish) { // LLVM: %[[RET:.*]] = load i64, ptr %[[RETADDR]], align // LLVM: ret i64 %[[RET]] + // TODO: Fix inconsistency with LLVM (ptrtoint vs ptrtoaddr) // OGCG-LABEL: define dso_local {{.*}}i64 @_Z4sizePmS_( - // OGCG: %[[IA:.*]] = ptrtoint ptr %{{.*}} to i64 - // OGCG: %[[IB:.*]] = ptrtoint ptr %{{.*}} to i64 + // OGCG: %[[IA:.*]] = ptrtoaddr ptr %{{.*}} to i64 + // OGCG: %[[IB:.*]] = ptrtoaddr ptr %{{.*}} to i64 // OGCG: %[[SUB:.*]] = sub i64 %[[IA]], %[[IB]] // OGCG: %[[Q:.*]] = sdiv exact i64 %[[SUB]], 8 // OGCG: ret i64 %[[Q]] return static_cast<size_type>(_finish - _start); -} \ No newline at end of file +} _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
