This is an archive of the discontinued LLVM Phabricator instance.

[libcxx] Support for Objective-C++ tests
ClosedPublic

Authored by erik.pilkington on May 10 2017, 9:24 AM.

Details

Summary

This patch adds lit testing support for Objective-C++. I'm going to be working on improving Objective-C++ support in libc++ this summer, and it would be nice to write tests. I tested this patch on Ubuntu 16.04 with gcc 5.4, and it works fine (the .mm tests become UNSUPPORTED).

Thanks for taking a look!
Erik

Diff Detail

Event Timeline

dexonsmith added inline comments.May 13 2017, 2:12 PM
utils/libcxx/compiler.py
112–113

Do we need/want a way to choose between ARC and no-ARC?

In this new patch:

  • Add support for toggling -fobjc-arc, this is done by using file extensions, ie: foo.arc.pass.mm instead of foo.pass.mm. (Thanks @dexonsmith for the suggestion!)
  • Clean up/simplify things a bit

Thanks,
Erik

Would be good to test for the presence/absence of the flag, too:

test/libcxx/selftest/test.arc.pass.mm
10
#if __has_feature(objc_arc) != 1
#error "arc should be enabled"
#endif
test/libcxx/selftest/test.pass.mm
10
#if __has_feature(objc_arc) == 1
#error "arc should *not* be enabled"
#endif
erik.pilkington marked an inline comment as done.

This new patch checks to make sure ARC is enabled in the tests, thanks for the suggestion!

This revision is now accepted and ready to land.May 19 2017, 3:37 PM
This revision was automatically updated to reflect the committed changes.