This is an archive of the discontinued LLVM Phabricator instance.

[libcxx] Add logic to probe compiler in tests.
ClosedPublic

Authored by EricWF on Nov 24 2014, 6:54 PM.

Details

Summary

This patch probes the cxx compiler used during testing by getting it to dump its predefined macros. Based on the value of these macros the compiler name and compiler name + version are added to the available features.

There are three compiler names:

  • clang
  • apple-clang
  • gcc.

The available features added are equivalent to:

  • '%s' % compiler_name
  • '%s-%s.%s' % compiler_name, major_version, minor_version

This information can be used to XFAIL tests on different compilers / versions.

Diff Detail

Event Timeline

EricWF updated this revision to Diff 16594.Nov 24 2014, 6:54 PM
EricWF retitled this revision from to [libcxx] Add logic to probe compiler in tests..
EricWF updated this object.
EricWF edited the test plan for this revision. (Show Details)
EricWF added reviewers: mclow.lists, danalbert, jroelofs.
EricWF added a subscriber: Unknown Object (MLST).
EricWF updated this revision to Diff 16595.Nov 24 2014, 6:57 PM

Remove brackets to maintain consistent style throughout file.

jroelofs accepted this revision.Nov 25 2014, 6:41 AM
jroelofs edited edge metadata.

Which tests do you expect to add XFAIL/UNSUPPORTED to based on these new features?

Also... LGTM

This revision is now accepted and ready to land.Nov 25 2014, 6:41 AM

There are some compiler bugs in the handling of _Atomic with trivial types that I want to XFAIL (they were fixed in 3.5 but the most recent apple clang doesn't have the fix).
I also think there are problems with relaxed constexpr in older versions of clang.

Thanks for the review.

EricWF closed this revision.Dec 6 2014, 1:13 PM