Skip to content

Commit

Permalink
testgenerator.py: The Clang -working-directory option needs an absolute
Browse files Browse the repository at this point in the history
path.

I apparently broke this in #412 and neglected to test testgenerator.py.
  • Loading branch information
mattmccutchen-cci committed Mar 10, 2021
1 parent 52fafae commit df75761
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions clang/test/3C/testgenerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -743,8 +743,10 @@ def annot_gen_smart(prefix, proto, suffix):
# name = prefix + proto + suffix + "_BUG.c"
else:
# In this case, since there are two source files, clang will give an error if we try to
# specify a single output file with -o. -working-directory seems to be the easiest solution.
out = subprocess.Popen(['{}clang'.format(bin_path), '-working-directory=tmp.checkedNOALL', '-c', name, name2], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
# specify a single output file with -o. -working-directory seems to be the easiest solution,
# but we need to make the path absolute (https://bugs.llvm.org/show_bug.cgi?id=24586).
cwd = os.getcwd()
out = subprocess.Popen(['{}clang'.format(bin_path), '-working-directory={}/tmp.checkedNOALL'.format(cwd), '-c', name, name2], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
stdout, stderr = out.communicate()
stdout = str(stdout)
if "error:" in stdout:
Expand Down

0 comments on commit df75761

Please sign in to comment.