Skip to content
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

[ADT] Use separate variables in a unit test for SmallPtrSet (NFC) #131748

Merged

Conversation

kazutakahirata
Copy link
Contributor

No description provided.

@llvmbot
Copy link
Member

llvmbot commented Mar 18, 2025

@llvm/pr-subscribers-llvm-adt

Author: Kazu Hirata (kazutakahirata)

Changes

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

1 Files Affected:

  • (modified) llvm/unittests/ADT/SmallPtrSetTest.cpp (+5-3)
diff --git a/llvm/unittests/ADT/SmallPtrSetTest.cpp b/llvm/unittests/ADT/SmallPtrSetTest.cpp
index 2a634a68d6e66..fb002cce65092 100644
--- a/llvm/unittests/ADT/SmallPtrSetTest.cpp
+++ b/llvm/unittests/ADT/SmallPtrSetTest.cpp
@@ -412,11 +412,13 @@ TEST(SmallPtrSetTest, RemoveIf) {
 }
 
 TEST(SmallPtrSetTest, InsertRange) {
-  int Vals[3] = {0, 1, 2};
+  int V0 = 0;
+  int V1 = 1;
+  int V2 = 2;
   SmallPtrSet<int *, 4> Set;
-  int *Args[] = {&Vals[2], &Vals[0], &Vals[1]};
+  int *Args[] = {&V2, &V0, &V1};
   Set.insert_range(Args);
-  EXPECT_THAT(Set, UnorderedElementsAre(&Vals[0], &Vals[1], &Vals[2]));
+  EXPECT_THAT(Set, UnorderedElementsAre(&V0, &V1, &V2));
 }
 
 TEST(SmallPtrSetTest, Reserve) {

@kazutakahirata kazutakahirata merged commit 0753244 into llvm:main Mar 18, 2025
13 checks passed
@kazutakahirata kazutakahirata deleted the cleanup_001_set_SmallPtrSet_unittest branch March 18, 2025 14: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