This is an archive of the discontinued LLVM Phabricator instance.

[test-suite] Add a simple test for class member functions in a custom section
ClosedPublic

Authored by daltenty on Jul 6 2023, 6:55 PM.

Details

Summary

Since there were some problems with the result of these cases, leading to invalid assembly/object code on some platforms.
Fixed by https://reviews.llvm.org/D147184.

Diff Detail

Repository
rT test-suite

Event Timeline

daltenty created this revision.Jul 6 2023, 6:55 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 6 2023, 6:55 PM
daltenty requested review of this revision.Jul 6 2023, 6:55 PM
daltenty retitled this revision from [test-suite] Add a simple test for class members in a custom section to [test-suite] Add a simple test for class member functions in a custom section.
SingleSource/Regression/C++/custom_section_members.cpp
2

Minor nit: grammar.

13

clang-format not happy in pre-merge checks.

hubert.reinterpretcast edited the summary of this revision. (Show Details)Jul 11 2023, 5:17 PM
SingleSource/Regression/C++/custom_section_members.cpp
12

The second function is more likely to be misaligned and should also be called. In particular, since there was also a change recently on AIX to use integrated-as by default, nothing in the test as-is detects the misaligned branch/misaligned instruction that occurs without the fix for this issue.

daltenty marked 2 inline comments as done.Jul 12 2023, 6:56 AM
daltenty added inline comments.
SingleSource/Regression/C++/custom_section_members.cpp
12

In particular, since there was also a change recently on AIX to use integrated-as by default, nothing in the test as-is detects the misaligned branch/misaligned instruction that occurs without the fix for this issue.

Yep, I think that's a limitation unfortunately since we rely on the assembler for the diagnostic. When looking at the original issue, I noticed some other Power assemblers (i.e. GNU as) would not diagnose this case either, but instead just silently correct the alignment.

daltenty updated this revision to Diff 539541.Jul 12 2023, 6:57 AM
daltenty marked an inline comment as done.

Address comments

daltenty marked an inline comment as done.Jul 12 2023, 6:57 AM
This revision is now accepted and ready to land.Jul 12 2023, 10:42 AM
This revision was landed with ongoing or failed builds.Jul 13 2023, 11:16 AM
This revision was automatically updated to reflect the committed changes.
steven_wu added a subscriber: steven_wu.EditedJul 27 2023, 10:21 AM

This break all the Darwin Bots. MachO section names need to be __SEGMENT,__SECTION.