This is an archive of the discontinued LLVM Phabricator instance.

Make CodeGenCXX/arm-swiftcall.cpp tolerate C++11
ClosedPublic

Authored by probinson on Dec 19 2016, 2:33 PM.

Details

Summary

The test conjures up and returns a temp which has a struct type, and the struct has some empty/padding bytes in the middle. In C++03 these are handled as zero, so the code uses 'llvm.memset' to initialize the temp.
In C++11, the padding is handled as undef, so the code uses 'llvm.memcpy' instead, making the test fail.

I've made the test run twice, once per dialect, and check for the appropriate intrinsic.
It doesn't look like this is the point of the test, though,. so maybe hard-coding the dialect would be preferable.

Diff Detail

Repository
rL LLVM

Event Timeline

probinson updated this revision to Diff 82017.Dec 19 2016, 2:33 PM
probinson retitled this revision from to Make CodeGenCXX/arm-swiftcall.cpp tolerate C++11.
probinson updated this object.
probinson added a reviewer: rjmccall.
probinson added a subscriber: cfe-commits.
rjmccall edited edge metadata.Dec 19 2016, 2:40 PM

Yes, I think being more specific about the dialect would be better.

probinson updated this revision to Diff 82021.Dec 19 2016, 2:47 PM
probinson edited edge metadata.

Force C++03 on this test, to make it insensitive to future changes in the default dialect.

rjmccall accepted this revision.Dec 19 2016, 3:30 PM
rjmccall edited edge metadata.

LGTM, thanks!

This revision is now accepted and ready to land.Dec 19 2016, 3:30 PM
This revision was automatically updated to reflect the committed changes.