Skip to content

Commit df75761

Browse files
testgenerator.py: The Clang -working-directory option needs an absolute
path. I apparently broke this in #412 and neglected to test testgenerator.py.
1 parent 52fafae commit df75761

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

clang/test/3C/testgenerator.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -743,8 +743,10 @@ def annot_gen_smart(prefix, proto, suffix):
743743
# name = prefix + proto + suffix + "_BUG.c"
744744
else:
745745
# In this case, since there are two source files, clang will give an error if we try to
746-
# specify a single output file with -o. -working-directory seems to be the easiest solution.
747-
out = subprocess.Popen(['{}clang'.format(bin_path), '-working-directory=tmp.checkedNOALL', '-c', name, name2], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
746+
# specify a single output file with -o. -working-directory seems to be the easiest solution,
747+
# but we need to make the path absolute (https://bugs.llvm.org/show_bug.cgi?id=24586).
748+
cwd = os.getcwd()
749+
out = subprocess.Popen(['{}clang'.format(bin_path), '-working-directory={}/tmp.checkedNOALL'.format(cwd), '-c', name, name2], stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
748750
stdout, stderr = out.communicate()
749751
stdout = str(stdout)
750752
if "error:" in stdout:

0 commit comments

Comments
 (0)