Author: Mariya Podchishchaeva
Date: 2026-09-07T14:48:43+02:00
New Revision: ac129cd8965f557bbc361011c3c28a378b86c969

URL: 
https://github.com/llvm/llvm-project/commit/ac129cd8965f557bbc361011c3c28a378b86c969
DIFF: 
https://github.com/llvm/llvm-project/commit/ac129cd8965f557bbc361011c3c28a378b86c969.diff

LOG: [CIR] Fix ptrdiff tests after 1191f353cefe3c7ceb8e76fd03296e082a247685 
(#221703)

Added: 
    

Modified: 
    clang/test/CIR/CodeGen/ptrdiff.c
    clang/test/CIR/CodeGen/ptrdiff.cpp

Removed: 
    


################################################################################
diff  --git a/clang/test/CIR/CodeGen/ptr
diff .c b/clang/test/CIR/CodeGen/ptr
diff .c
index 26ce6f718e96f..b23879289c653 100644
--- a/clang/test/CIR/CodeGen/ptr
diff .c
+++ b/clang/test/CIR/CodeGen/ptr
diff .c
@@ -18,12 +18,9 @@ int addrcmp(const void* a, const void* b) {
   // LLVM: trunc i64 %[[SUB]] to i32
 
   // TODO: Fix inconsistency with LLVM (ptrtoint vs ptrtoaddr).
-  // Classic-codegen seems to have temporarily reverted that
-  // 
diff erence, but we should leave the TODO to make sure we
-  // don't lose it next time it comes back.
   // 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
@@ -46,12 +43,9 @@ unsigned long long test_ptr_
diff (int *a, int* b) {
   // LLVM: ret i64 %[[RETLOAD]]
 
   // TODO: Fix inconsistency with LLVM (ptrtoint vs ptrtoaddr).
-  // Classic-codegen seems to have temporarily reverted that
-  // 
diff erence, but we should leave the TODO to make sure we
-  // don't lose it next time it comes back.
   // 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]]

diff  --git a/clang/test/CIR/CodeGen/ptr
diff .cpp b/clang/test/CIR/CodeGen/ptr
diff .cpp
index a88c9fc335a4a..f55dc81a1d28b 100644
--- a/clang/test/CIR/CodeGen/ptr
diff .cpp
+++ b/clang/test/CIR/CodeGen/ptr
diff .cpp
@@ -23,12 +23,9 @@ size_type size(unsigned long *_start, unsigned long 
*_finish) {
   // LLVM: ret i64 %[[RET]]
 
   // TODO: Fix inconsistency with LLVM (ptrtoint vs ptrtoaddr).
-  // Classic-codegen seems to have temporarily reverted that
-  // 
diff erence, but we should leave the TODO to make sure we
-  // don't lose it next time it comes back.
   // 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]]


        
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to