Page MenuHomePhabricator

[Sema][SVE] Add tests for valid and invalid type usage
ClosedPublic

Authored by rsandifo-arm on Mar 3 2020, 2:38 PM.

Details

Summary

This patch adds C and C++ tests for various uses of SVE types.
The tests cover valid uses that are already (correctly) accepted and
invalid uses that are already (correctly) rejected. Later patches
will expand the tests as they fix other cases.[*]

Some of the tests for invalid uses aren't obviously related to
scalable vectors. Part of the reason for having them is to make
sure that the quality of the error message doesn't regress once/if
the types are treated as incomplete types.

  • These later patches all fix invalid uses that are being incorrectly accepted. I don't know of any cases in which valid uses are being incorrectly rejected. In other words, this series is all about diagnosing invalid code rather than enabling something new.

Diff Detail

Event Timeline

rsandifo-arm created this revision.Mar 3 2020, 2:38 PM
Herald added a project: Restricted Project. · View Herald Transcript

Changes in v2:

  • Reformat the tests using git-clang-format
efriedma added inline comments.Mar 4 2020, 4:06 PM
clang/test/SemaCXX/sizeless-1.cpp
9

This is a lot of RUN lines (both here and in the other file). Are you really getting any significant benefit from them?

Changes in v3:

  • Prune the number of RUN: lines.
  • Minor tweaks to the tests themselves.
rsandifo-arm marked 2 inline comments as done.Mar 5 2020, 2:01 PM
rsandifo-arm added inline comments.
clang/test/SemaCXX/sizeless-1.cpp
9

Yeah, I probably went a bit overboard there. The idea originally was to make sure that sizeless types worked with every standard, but of course that list is going to get out of date fast. (E.g. it predated C++20.)

I've now restricted it to:

  • the earliest standard
  • standards that are tested explicitly in preprocessor conditions
  • one gnu standard per test
This revision is now accepted and ready to land.Mar 11 2020, 7:13 PM
This revision was automatically updated to reflect the committed changes.
rsandifo-arm marked an inline comment as done.