[tests] Use size_t in variable reflection offset tests#622
[tests] Use size_t in variable reflection offset tests#622aaronj0 merged 1 commit intocompiler-research:mainfrom
size_t in variable reflection offset tests#622Conversation
This fixes failures on 32 bit platforms. Upstream of root-project/root#18992
|
|
||
| intptr_t offset = Cpp::GetVariableOffset(datamembers[0]); | ||
| EXPECT_EQ(3, *(int*)offset); | ||
| EXPECT_EQ(3, *(size_t*)offset); |
There was a problem hiding this comment.
warning: do not use C-style cast to convert between unrelated types [cppcoreguidelines-pro-type-cstyle-cast]
EXPECT_EQ(3, *(size_t*)offset);
^|
|
||
| intptr_t offset = Cpp::GetVariableOffset(datamembers[0]); | ||
| EXPECT_EQ(3, *(int*)offset); | ||
| EXPECT_EQ(3, *(size_t*)offset); |
There was a problem hiding this comment.
warning: integer to pointer cast pessimizes optimization opportunities [performance-no-int-to-ptr]
EXPECT_EQ(3, *(size_t*)offset);
^|
|
||
| offset = Cpp::GetVariableOffset(datamembers[0]); | ||
| EXPECT_EQ(5, *(int*)offset); | ||
| EXPECT_EQ(5, *(size_t*)offset); |
There was a problem hiding this comment.
warning: do not use C-style cast to convert between unrelated types [cppcoreguidelines-pro-type-cstyle-cast]
EXPECT_EQ(5, *(size_t*)offset);
^|
|
||
| offset = Cpp::GetVariableOffset(datamembers[0]); | ||
| EXPECT_EQ(5, *(int*)offset); | ||
| EXPECT_EQ(5, *(size_t*)offset); |
There was a problem hiding this comment.
warning: integer to pointer cast pessimizes optimization opportunities [performance-no-int-to-ptr]
EXPECT_EQ(5, *(size_t*)offset);
^|
|
||
| offset = Cpp::GetVariableOffset(datamembers[0]); | ||
| EXPECT_EQ(2, *(int*)offset); | ||
| EXPECT_EQ(2, *(size_t*)offset); |
There was a problem hiding this comment.
warning: do not use C-style cast to convert between unrelated types [cppcoreguidelines-pro-type-cstyle-cast]
EXPECT_EQ(2, *(size_t*)offset);
^|
|
||
| offset = Cpp::GetVariableOffset(datamembers[0]); | ||
| EXPECT_EQ(2, *(int*)offset); | ||
| EXPECT_EQ(2, *(size_t*)offset); |
There was a problem hiding this comment.
warning: integer to pointer cast pessimizes optimization opportunities [performance-no-int-to-ptr]
EXPECT_EQ(2, *(size_t*)offset);
^
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #622 +/- ##
=======================================
Coverage 77.66% 77.66%
=======================================
Files 9 9
Lines 3743 3743
=======================================
Hits 2907 2907
Misses 836 836 🚀 New features to boost your workflow:
|
This fixes failures on big endian systems (s390x). Upstream of root-project/root#18992