This is an archive of the discontinued LLVM Phabricator instance.

[test] Add ext_vector_type tests for C
ClosedPublic

Authored by porglezomp on May 22 2023, 12:03 AM.

Details

Summary

Test that all vector-vs-scalar builtin operators type check
successfully.

Diff Detail

Event Timeline

porglezomp created this revision.May 22 2023, 12:03 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 22 2023, 12:03 AM
Herald added a subscriber: StephenFan. · View Herald Transcript
porglezomp requested review of this revision.May 22 2023, 12:03 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 22 2023, 12:03 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript

See also: very similar baseline tests for C++: D151059

I'm interested in any feedback about the correct semantics for this.
I started writing these tests while investigating the behavior of vector vs scalar operations in C++ for D151060 and finding a lot of that inconsistent.
I want to get down checks that these cases are all appropriately accepted.
Interested in feedback from anyone working with the ext_vector_types.

fhahn added a comment.May 22 2023, 3:41 AM

Thanks for texting the test coverage!

clang/test/Sema/ext_vector_ops.c
30

Not sure if vs is the right connector here, maybe something like Operators with one integer vector and scalar.. Period at end of These will splat

Thank you for the additional test coverage! The changes LGTM modulo the suggestion from @fhahn on how to improve the comments. (Note, given your goal of verifying that operations work, you might want to consider adding similar coverage for CodeGen tests to verify that we emit sensible LLVM IR for each of these operations as well, if we don't already have sufficient coverage for it.)

Address the comment suggestions

fhahn accepted this revision.May 22 2023, 11:34 AM

LGTM, thanks!

This revision is now accepted and ready to land.May 22 2023, 11:34 AM
This revision was automatically updated to reflect the committed changes.