Skip to content

[libc] Fix arm32 tests #74457

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 5, 2023
Merged

[libc] Fix arm32 tests #74457

merged 2 commits into from
Dec 5, 2023

Conversation

gchatelet
Copy link
Contributor

@gchatelet gchatelet commented Dec 5, 2023

ASSERT_EQ requires that both operands have the same type but on arm32 size_t is unsigned int instead of unsigned long. Using size_t explicitely to avoid "conflicting types for parameter 'ValType"

@llvmbot llvmbot added the libc label Dec 5, 2023
@llvmbot
Copy link
Member

llvmbot commented Dec 5, 2023

@llvm/pr-subscribers-libc

Author: Guillaume Chatelet (gchatelet)

Changes

ASSERT_EQ requires that both operands have the same type but on arm32 size_t is unsigned int instead of unsigned long. Using size_t explicitely to avoid "conflicting types for parameter 'ValType'"


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

1 Files Affected:

  • (modified) libc/test/src/__support/memory_size_test.cpp (+6-6)
diff --git a/libc/test/src/__support/memory_size_test.cpp b/libc/test/src/__support/memory_size_test.cpp
index 3cfddeb499d48..80cb195185126 100644
--- a/libc/test/src/__support/memory_size_test.cpp
+++ b/libc/test/src/__support/memory_size_test.cpp
@@ -83,13 +83,13 @@ TEST(LlvmLibcMemSizeTest, AlignUp) {
 }
 
 TEST(LlvmLibcBlockBitTest, OffsetTo) {
-  ASSERT_EQ(SafeMemSize::offset_to(0, 512), 0UL);
-  ASSERT_EQ(SafeMemSize::offset_to(1, 512), 511UL);
-  ASSERT_EQ(SafeMemSize::offset_to(2, 512), 510UL);
-  ASSERT_EQ(SafeMemSize::offset_to(13, 1), 0UL);
-  ASSERT_EQ(SafeMemSize::offset_to(13, 4), 3UL);
+  ASSERT_EQ(SafeMemSize::offset_to(0, 512), size_t(0));
+  ASSERT_EQ(SafeMemSize::offset_to(1, 512), size_t(511));
+  ASSERT_EQ(SafeMemSize::offset_to(2, 512), size_t(510));
+  ASSERT_EQ(SafeMemSize::offset_to(13, 1), size_t(0));
+  ASSERT_EQ(SafeMemSize::offset_to(13, 4), size_t(3));
   for (unsigned int i = 0; i < 31; ++i) {
-    ASSERT_EQ((SafeMemSize::offset_to(i, 1u << i) + i) % (1u << i), 0UL);
+    ASSERT_EQ((SafeMemSize::offset_to(i, 1u << i) + i) % (1u << i), size_t(0));
   }
 }
 } // namespace internal

@gchatelet gchatelet merged commit 21b9866 into llvm:main Dec 5, 2023
@gchatelet gchatelet deleted the fix_arm32_buildbot branch December 5, 2023 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants