1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-18 18:42:46 +02:00

[update_cc_test_checks.py] Pass the builtin include dir to clang

Summary:
This is required to update tests that make use of builtin headers. To fix
this use the same command expansion as lit does for %clang_cc1. I tested
this by updating clang/test/CodeGen/arm-mve-intrinsics/scalar-shifts.c.
%clang_cc1 will now expand to `clang -cc1 -internal-isystem
$LLVM_BUILD/lib/clang/$VERSION/include -nostdsysteminc`.

Reviewers: MaskRay

Reviewed By: MaskRay

Subscribers: kristof.beyls, dmgreen, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D69611
This commit is contained in:
Alex Richardson 2019-10-31 21:18:32 +00:00
parent 2bf23c7e0e
commit 48c9bf1f95

View File

@ -117,6 +117,18 @@ def config():
print('Please specify --llvm-bin or --clang', file=sys.stderr)
sys.exit(1)
# Determine the builtin includes directory so that we can update tests that
# depend on the builtin headers. See get_clang_builtin_include_dir() and
# use_clang() in llvm/utils/lit/lit/llvm/config.py.
try:
builtin_include_dir = subprocess.check_output(
[args.clang, '-print-file-name=include']).decode().strip()
SUBST['%clang_cc1'] = ['-cc1', '-internal-isystem', builtin_include_dir,
'-nostdsysteminc']
except subprocess.CalledProcessError:
common.warn('Could not determine clang builtins directory, some tests '
'might not update correctly.')
if args.opt is None:
if args.llvm_bin is None:
args.opt = 'opt'