This is an archive of the discontinued LLVM Phabricator instance.

Fix definitions of __builtin_(add|sub|mul)_overflow
ClosedPublic

Authored by mantognini on Oct 4 2018, 3:41 AM.

Diff Detail

Repository
rC Clang

Event Timeline

mantognini created this revision.Oct 4 2018, 3:41 AM

Can you write tests for this please? Particularly validate the results in a constexpr context.

Additionally, these all have the 't' flag, which means that these signatures are meaningless, right? What are you seeing where this works incorrectly?

Can you write tests for this please? Particularly validate the results in a constexpr context.

There are already some tests for those builtins (not sure about constexpr context). They already tests that the builtins can be used as branching condition. However, the current implementation of Sema::BuildResolvedCallExpr assumes that by default builtins return bool. In https://reviews.llvm.org/D52879, I improve that and not having the above fix makes the existing tests fail, so I believe we don't need to add more tests.

Additionally, these all have the 't' flag, which means that these signatures are meaningless, right? What are you seeing where this works incorrectly?

I reckon the signature does't include the return type, hence it isn't meaningless even with the t flag.

erichkeane accepted this revision.Oct 4 2018, 6:46 AM
This revision is now accepted and ready to land.Oct 4 2018, 6:46 AM
This revision was automatically updated to reflect the committed changes.