This is an archive of the discontinued LLVM Phabricator instance.

[clang] Add test cases for multiversion function overload scenarios in C.
ClosedPublic

Authored by tahonermann on Mar 17 2022, 2:18 PM.

Details

Summary

This change adds test cases to validate diagnostics for overloaded sets
that contain declarations of multiversion functions. Many of the added test
cases exercise declarations that are intended to be valid. Others are
intended to be valid if and when restrictions on multiversion functions
being declared with the overloadable attribute are lifted.

Several of the new test cases currently trigger the following assertion
failure in SemaDecl.cpp; the relevant test is therefore marked as an
expected failure pending a fix.

Assertion `(Previous.empty() || llvm::any_of(Previous, [](const NamedDecl *ND) { return ND->hasAttr(); })) && "Non-redecls shouldn't happen without overloadable present"' failed.

Diff Detail

Event Timeline

tahonermann created this revision.Mar 17 2022, 2:18 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 17 2022, 2:18 PM
tahonermann published this revision for review.Mar 17 2022, 2:42 PM
tahonermann added inline comments.
clang/test/Sema/attr-cpuspecific.c
2

This XFAIL line is removed with the changes in D121959.

123–125

These FIXME comments are removed with the changes in D121959.

clang/test/Sema/attr-target-mv.c
2

This XFAIL line is removed with the changes in D121959.

112–114

These FIXME comments are removed with the changes in D121959.

Herald added a project: Restricted Project. · View Herald TranscriptMar 17 2022, 2:42 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
erichkeane accepted this revision.Mar 18 2022, 6:59 AM

These all look like fine tests to me.

This revision is now accepted and ready to land.Mar 18 2022, 6:59 AM