[clang][cir] Fix tests post #210729 - #216963
Merged
Merged
Conversation
aengelke
approved these changes
Aug 18, 2026
|
@llvm/pr-subscribers-clang @llvm/pr-subscribers-clangir Author: Andrzej Warzyński (banach-space) ChangesFull diff: https://github.com/llvm/llvm-project/pull/216963.diff 2 Files Affected:
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
+}
|
🐧 Linux x64 Test Results
All executed tests passed, but another part of the build failed. Click on a failure below to see the details. tools/lldb/unittests/ValueObject/CMakeFiles/LLDBValueObjectTests.dir/GetPointeeDataTest.cpp.oIf these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the |
banach-space
enabled auto-merge (squash)
August 18, 2026 10:26
banach-space
disabled auto-merge
August 18, 2026 12:11
Contributor
|
Thanks! I've filed an issue (#217026) for us to keep track of this missed functionality/difference in behavior (I almost wonder if we should have a @andykaylor and @bcardosolopes for visibility. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.