Skip to content

Commit

Permalink
[update_cc_test_checks.py] Pass the builtin include dir to clang
Browse files Browse the repository at this point in the history
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
  • Loading branch information
arichardson committed Oct 31, 2019
1 parent 8baedb8 commit d9cc7d1
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions llvm/utils/update_cc_test_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit d9cc7d1

Please sign in to comment.