[PATCH] D107953: [Flang] test_symbols.py module file fix
Ivan Zhechev via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 1 07:03:07 PDT 2021
This revision was automatically updated to reflect the committed changes.
Closed by commit rG5a3a12661829: [Flang] test_symbols.py module file fix (authored by ijan1).
Changed prior to commit:
https://reviews.llvm.org/D107953?vs=366903&id=369918#toc
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D107953/new/
https://reviews.llvm.org/D107953
Files:
flang/test/Semantics/test_symbols.py
Index: flang/test/Semantics/test_symbols.py
===================================================================
--- flang/test/Semantics/test_symbols.py
+++ flang/test/Semantics/test_symbols.py
@@ -3,10 +3,14 @@
"""Compiles a source file with "-fdebug-unparse-with-symbols' and verifies
we get the right symbols in the output, i.e. the output should be
the same as the input, except for the copyright comment.
-Expects a source file passed as the first argument;
-Expects the Flang frontend driver with options as second argument."""
+
+Parameters:
+ sys.argv[1]: a source file with contains the input and expected output
+ sys.argv[2]: the Flang frontend driver
+ sys.argv[3:]: Optional arguments to the Flang frontend driver"""
import sys
+import tempfile
import re
import subprocess
import common as cm
@@ -36,7 +40,8 @@
# Compiles, inserting comments for symbols:
cmd = [flang_fc1, *flang_fc1_args, flang_fc1_options]
-diff3 = subprocess.check_output(cmd, input=diff2, universal_newlines=True)
+with tempfile.TemporaryDirectory() as tmpdir:
+ diff3 = subprocess.check_output(cmd, input=diff2, universal_newlines=True, cwd=tmpdir)
# Removes all whitespace to compare differences in files
diff1 = diff1.replace(" ", "")
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D107953.369918.patch
Type: text/x-patch
Size: 1251 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210901/9a0bdab4/attachment.bin>
More information about the llvm-commits
mailing list