This is an archive of the discontinued LLVM Phabricator instance.

[clang] Add tests for (const) weak variables
ClosedPublic

Authored by wanders on May 27 2022, 4:31 PM.

Details

Summary

This adds tests checking the behavior of const variables declared with
weak attribute.

Both checking that they can not be used in places where a constant
expression is required and that a dynamic initializer is emitted when
used as an initializer expression.

Diff Detail

Event Timeline

wanders created this revision.May 27 2022, 4:31 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 27 2022, 4:31 PM
wanders requested review of this revision.May 27 2022, 4:31 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 27 2022, 4:31 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript

Thanks for looking to improve our test coverage here! However, precommit CI looks to be failing:

********************
Failed Tests (1):
  Clang :: CodeGenCXX/weak-init.cpp
wanders updated this revision to Diff 432742.May 28 2022, 11:27 AM

Added explicit triple to hopefully make it pass on win.
Made the new files clang-format clean.

Thanks for looking to improve our test coverage here! However, precommit CI looks to be failing:

Thanks for notifying me. It should be green now.

This revision is now accepted and ready to land.Jun 1 2022, 9:11 AM
This revision was automatically updated to reflect the committed changes.