Skip to content

[NFC] Remove unnececary check from test #112438

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

Conversation

vitalybuka
Copy link
Collaborator

Important part of the test to have correct
ThreadDescriptorSize after InitTlsSize().

It's not a problem if another test called
InitTlsSize() before.

Fixes #112399.

Created using spr 1.3.4
@vitalybuka vitalybuka merged commit e12fbdf into main Oct 15, 2024
8 of 9 checks passed
@vitalybuka vitalybuka deleted the users/vitalybuka/spr/nfc-remove-unnececary-check-from-test branch October 15, 2024 21:37
@llvmbot
Copy link
Member

llvmbot commented Oct 15, 2024

@llvm/pr-subscribers-compiler-rt-sanitizer

Author: Vitaly Buka (vitalybuka)

Changes

Important part of the test to have correct
ThreadDescriptorSize after InitTlsSize().

It's not a problem if another test called
InitTlsSize() before.

Fixes #112399.


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

1 Files Affected:

  • (modified) compiler-rt/lib/sanitizer_common/tests/sanitizer_linux_test.cpp (-1)
diff --git a/compiler-rt/lib/sanitizer_common/tests/sanitizer_linux_test.cpp b/compiler-rt/lib/sanitizer_common/tests/sanitizer_linux_test.cpp
index ce4a40444cd496..70669ab81691b8 100644
--- a/compiler-rt/lib/sanitizer_common/tests/sanitizer_linux_test.cpp
+++ b/compiler-rt/lib/sanitizer_common/tests/sanitizer_linux_test.cpp
@@ -205,7 +205,6 @@ TEST(SanitizerLinux, ThreadDescriptorSize) {
   void *result;
   ASSERT_EQ(0, pthread_create(&tid, 0, thread_descriptor_size_test_func, 0));
   ASSERT_EQ(0, pthread_join(tid, &result));
-  EXPECT_EQ(0u, ThreadDescriptorSize());
   InitTlsSize();
   EXPECT_EQ((uptr)result, ThreadDescriptorSize());
 }

@vitalybuka vitalybuka added the skip-precommit-approval PR for CI feedback, not intended for review label Oct 15, 2024
DanielCChen pushed a commit to DanielCChen/llvm-project that referenced this pull request Oct 16, 2024
Important part of the test to have correct
`ThreadDescriptorSize` after `InitTlsSize()`.

It's not a problem if another test called
`InitTlsSize()` before.

Fixes llvm#112399.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler-rt:sanitizer compiler-rt skip-precommit-approval PR for CI feedback, not intended for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[compiler-rt] ThreadDescriptorSize is flaky (fails if other tests call InitTlsSize() first)
2 participants