Page MenuHomePhabricator

Add `%match_min_os_deployment_version_to_target` lit substitution.
Needs ReviewPublic

Authored by delcypher on Nov 12 2019, 5:27 PM.

Details

Reviewers
yln
kubamracek
Summary

This substitution expands to the clang flag that sets the minimum
deployment target OS version to the version of the OS that the
testing target uses.

This requires querying the test target at testing time
for the OS version of the target. We assume that
%run sw_vers -productVersion can obtain this.

For the iOS simulator the sw_vers command does not exist
so we emulate a subset of the command's capabilities by
probing the environment of the simulator.

The motivation here is that bbde056b88 made all sanitizer tests
run with the lowest deployment target possible. This means we
no longer test newer deployment targets. This patch will make it
possible to write lit tests that target newer deployment targets.

rdar://problem/57127911