Skip to content

[clang][cir] Fix tests post #210729 - #216963

Merged
banach-space merged 1 commit into
llvm:mainfrom
banach-space:andrzej/cir/fix_test
Aug 18, 2026
Merged

[clang][cir] Fix tests post #210729#216963
banach-space merged 1 commit into
llvm:mainfrom
banach-space:andrzej/cir/fix_test

Conversation

@banach-space

Copy link
Copy Markdown
Contributor

No description provided.

@llvmorg-github-actions llvmorg-github-actions Bot added clang Clang issues not falling into any other category ClangIR Anything related to the ClangIR project labels Aug 18, 2026
@llvmorg-github-actions

llvmorg-github-actions Bot commented Aug 18, 2026

Copy link
Copy Markdown

@llvm/pr-subscribers-clang

@llvm/pr-subscribers-clangir

Author: Andrzej Warzyński (banach-space)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/216963.diff

2 Files Affected:

  • (modified) clang/test/CIR/CodeGen/ptrdiff.c (+7-5)
  • (modified) clang/test/CIR/CodeGen/ptrdiff.cpp (+4-3)
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
+}

@github-actions

Copy link
Copy Markdown

🐧 Linux x64 Test Results

  • 58755 tests passed
  • 308 tests skipped

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.o
FAILED: tools/lldb/unittests/ValueObject/CMakeFiles/LLDBValueObjectTests.dir/GetPointeeDataTest.cpp.o
sccache /opt/llvm/bin/clang++ -DHAVE_ROUND -DLLVM_BUILD_STATIC -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GLIBCXX_USE_CXX11_ABI=1 -D_GNU_SOURCE -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/lldb/unittests/ValueObject -I/home/gha/actions-runner/_work/llvm-project/llvm-project/lldb/unittests/ValueObject -I/home/gha/actions-runner/_work/llvm-project/llvm-project/lldb/include -I/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/lldb/include -I/home/gha/actions-runner/_work/llvm-project/llvm-project/build/include -I/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include -I/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/../clang/include -I/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/lldb/../clang/include -I/home/gha/actions-runner/_work/llvm-project/llvm-project/lldb/source -I/home/gha/actions-runner/_work/llvm-project/llvm-project/lldb/unittests -I/home/gha/actions-runner/_work/llvm-project/llvm-project/third-party/unittest/googletest/include -I/home/gha/actions-runner/_work/llvm-project/llvm-project/third-party/unittest/googlemock/include -isystem /usr/include/libxml2 -gmlt -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wno-pass-failed -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -Wno-unknown-pragmas -Wno-strict-aliasing -Wno-vla-extension -O3 -DNDEBUG -std=c++17 -UNDEBUG -Wno-suggest-override -Wno-variadic-macros -Wno-gnu-zero-variadic-macro-arguments -fno-exceptions -funwind-tables -fno-rtti -MD -MT tools/lldb/unittests/ValueObject/CMakeFiles/LLDBValueObjectTests.dir/GetPointeeDataTest.cpp.o -MF tools/lldb/unittests/ValueObject/CMakeFiles/LLDBValueObjectTests.dir/GetPointeeDataTest.cpp.o.d -o tools/lldb/unittests/ValueObject/CMakeFiles/LLDBValueObjectTests.dir/GetPointeeDataTest.cpp.o -c /home/gha/actions-runner/_work/llvm-project/llvm-project/lldb/unittests/ValueObject/GetPointeeDataTest.cpp
/home/gha/actions-runner/_work/llvm-project/llvm-project/lldb/unittests/ValueObject/GetPointeeDataTest.cpp:60:70: error: non-virtual member function marked 'override' hides virtual member function
60 |   size_t DoReadMemory(addr_t, void *buf, size_t size, Status &error) override {
|                                                                      ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/lldb/include/lldb/Target/Process.h:3055:18: note: hidden overloaded virtual function 'lldb_private::Process::DoReadMemory' declared here: type mismatch at 1st parameter ('const ProcessAddress &' vs 'addr_t' (aka 'unsigned long'))
3055 |   virtual size_t DoReadMemory(const ProcessAddress &process_addr, void *buf,
|                  ^
In file included from /home/gha/actions-runner/_work/llvm-project/llvm-project/lldb/unittests/ValueObject/GetPointeeDataTest.cpp:9:
In file included from /home/gha/actions-runner/_work/llvm-project/llvm-project/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.h:14:
In file included from /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/optional:44:
/usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_construct.h:119:25: error: allocating an object of abstract class type '(anonymous namespace)::SentinelProcess'
119 |       ::new((void*)__p) _Tp(std::forward<_Args>(__args)...);
|                         ^
/usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/alloc_traits.h:661:9: note: in instantiation of function template specialization 'std::_Construct<(anonymous namespace)::SentinelProcess, std::shared_ptr<lldb_private::Target> &, std::shared_ptr<lldb_private::Listener> &>' requested here
661 |         { std::_Construct(__p, std::forward<_Args>(__args)...); }
|                ^
/usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/shared_ptr_base.h:604:30: note: in instantiation of function template specialization 'std::allocator_traits<std::allocator<void>>::construct<(anonymous namespace)::SentinelProcess, std::shared_ptr<lldb_private::Target> &, std::shared_ptr<lldb_private::Listener> &>' requested here
604 |           allocator_traits<_Alloc>::construct(__a, _M_ptr(),
|                                     ^
/usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/shared_ptr_base.h:972:6: note: in instantiation of function template specialization 'std::_Sp_counted_ptr_inplace<(anonymous namespace)::SentinelProcess, std::allocator<void>, __gnu_cxx::_S_atomic>::_Sp_counted_ptr_inplace<std::shared_ptr<lldb_private::Target> &, std::shared_ptr<lldb_private::Listener> &>' requested here
972 |             _Sp_cp_type(__a._M_a, std::forward<_Args>(__args)...);
|             ^
/usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/shared_ptr_base.h:1712:14: note: in instantiation of function template specialization 'std::__shared_count<>::__shared_count<(anonymous namespace)::SentinelProcess, std::allocator<void>, std::shared_ptr<lldb_private::Target> &, std::shared_ptr<lldb_private::Listener> &>' requested here
1712 |         : _M_ptr(), _M_refcount(_M_ptr, __tag, std::forward<_Args>(__args)...)
|                     ^
/usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/shared_ptr.h:464:4: note: in instantiation of function template specialization 'std::__shared_ptr<(anonymous namespace)::SentinelProcess>::__shared_ptr<std::allocator<void>, std::shared_ptr<lldb_private::Target> &, std::shared_ptr<lldb_private::Listener> &>' requested here
464 |         : __shared_ptr<_Tp>(__tag, std::forward<_Args>(__args)...)
|           ^
/usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/shared_ptr.h:1009:14: note: in instantiation of function template specialization 'std::shared_ptr<(anonymous namespace)::SentinelProcess>::shared_ptr<std::allocator<void>, std::shared_ptr<lldb_private::Target> &, std::shared_ptr<lldb_private::Listener> &>' requested here
1009 |       return shared_ptr<_Tp>(_Sp_alloc_shared_tag<_Alloc>{__a},
|              ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/lldb/unittests/ValueObject/GetPointeeDataTest.cpp:132:26: note: in instantiation of function template specialization 'std::make_shared<(anonymous namespace)::SentinelProcess, std::shared_ptr<lldb_private::Target> &, std::shared_ptr<lldb_private::Listener> &>' requested here
132 |     auto sentinel = std::make_shared<SentinelProcess>(target_sp, listener_sp);
|                          ^
/home/gha/actions-runner/_work/llvm-project/llvm-project/lldb/include/lldb/Target/Process.h:3055:18: note: unimplemented pure virtual method 'DoReadMemory' in 'SentinelProcess'
3055 |   virtual size_t DoReadMemory(const ProcessAddress &process_addr, void *buf,
|                  ^
2 errors generated.

If 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 infrastructure label.

@AmrDeveloper AmrDeveloper left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, Thanks

@banach-space
banach-space enabled auto-merge (squash) August 18, 2026 10:26
@banach-space
banach-space disabled auto-merge August 18, 2026 12:11
@banach-space
banach-space merged commit b025f5b into llvm:main Aug 18, 2026
13 of 15 checks passed
@banach-space
banach-space deleted the andrzej/cir/fix_test branch August 18, 2026 12:16
@erichkeane

Copy link
Copy Markdown
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 MissingFeature for this one?).

@andykaylor and @bcardosolopes for visibility.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clang Clang issues not falling into any other category ClangIR Anything related to the ClangIR project

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants