This is an archive of the discontinued LLVM Phabricator instance.

Fixes for platforms that default to unsigned char
ClosedPublic

Authored by uweigand on Apr 11 2016, 11:34 AM.

Details

Summary

This fixes several test case failure on s390x caused by the fact that
on this platform, the default "char" type is unsigned.

  • In ClangASTContext::GetBuiltinTypeForEncodingAndBitSize we should return an explicit *signed* char type for encoding eEncodingSint and bit size 8, instead of the default platform char type (which may be unsigned). This fix matches existing code in ClangASTContext::GetIntTypeFromBitSize, and fixes the TestClangASTContext.TestBuiltinTypeForEncodingAndBitSize unit test case.
  • The test/expression_command/char/TestExprsChar.py test case is known to fail on platforms defaulting to unsigned char (pr23069), and just needs to be xfailed on s390x like on arm.
  • The test/functionalities/watchpoint/watchpoint_on_vectors/main.c test case defines a vector of "char" and implicitly assumes to be signed. Use an explicit "signed char" instead.

Diff Detail

Event Timeline

uweigand updated this revision to Diff 53294.Apr 11 2016, 11:34 AM
uweigand retitled this revision from to Fixes for platforms that default to unsigned char.
uweigand updated this object.
uweigand added reviewers: spyffe, clayborg.
uweigand added a subscriber: lldb-commits.
clayborg accepted this revision.Apr 11 2016, 1:50 PM
clayborg edited edge metadata.

Looks good.

This revision is now accepted and ready to land.Apr 11 2016, 1:50 PM
This revision was automatically updated to reflect the committed changes.