[PATCH] D121954: [clang] Add test cases for multiversion function overload scenarios in C.

Tom Honermann via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 17 14:42:40 PDT 2022


tahonermann created this revision.
Herald added a project: All.
tahonermann added reviewers: erichkeane, aaron.ballman.
tahonermann published this revision for review.
tahonermann added inline comments.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.


================
Comment at: clang/test/Sema/attr-cpuspecific.c:2
 // RUN: %clang_cc1 -triple x86_64-linux-gnu -Wno-strict-prototypes -fsyntax-only -verify %s -Wnonnull
+// XFAIL: asserts
 
----------------
This XFAIL line is removed with the changes in D121959.


================
Comment at: clang/test/Sema/attr-cpuspecific.c:123-125
+// FIXME: Declaration of a non-overloadable function when more than one
+// FIXME: multiversion function declarations are present results in an
+// FIXME: assertion failure.
----------------
These FIXME comments are removed with the changes in D121959.


================
Comment at: clang/test/Sema/attr-target-mv.c:2
 // RUN: %clang_cc1 -triple x86_64-linux-gnu -Wno-strict-prototypes -fsyntax-only -verify %s
+// XFAIL: asserts
 
----------------
This XFAIL line is removed with the changes in D121959.


================
Comment at: clang/test/Sema/attr-target-mv.c:112-114
+// FIXME: Declaration of a non-overloadable function when more than one
+// FIXME: multiversion function declarations are present results in an
+// FIXME: assertion failure.
----------------
These FIXME comments are removed with the changes in D121959.


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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D121954

Files:
  clang/test/Sema/attr-cpuspecific.c
  clang/test/Sema/attr-target-clones.c
  clang/test/Sema/attr-target-mv.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D121954.416319.patch
Type: text/x-patch
Size: 11483 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220317/e53ee491/attachment-0001.bin>


More information about the cfe-commits mailing list