Author: Andrzej WarzyƄski
Date: 2026-08-18T13:11:15+01:00
New Revision: b025f5b75941fcf2e719535473c51b5e0617c4f9

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

LOG: [clang][cir] Fix tests post #210729 (#216963)

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 e6a754ebc8d4b..cf28cedf0f7ec 100644
--- a/clang/test/CIR/CodeGen/ptr
diff .c
+++ b/clang/test/CIR/CodeGen/ptr
diff .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/ptr
diff .cpp b/clang/test/CIR/CodeGen/ptr
diff .cpp
index 5805349b74879..0d40c563c6403 100644
--- a/clang/test/CIR/CodeGen/ptr
diff .cpp
+++ b/clang/test/CIR/CodeGen/ptr
diff .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

Reply via email to