<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Mar 30, 2020, at 14:56, Dan Liew <<a href="mailto:dliew@apple.com" class="">dliew@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html; charset=us-ascii" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class="">Hi Louis,</div><div class=""><br class=""></div>Maybe `<font face="Menlo" class="">recursiveExpansionLimit`</font> should be made a property of the `<font face="Menlo" class="">TestingConfig</font>` objects (which appear to be per test suite and per-directory and are usually referred to using the `config` identifier in the lit.cfg files) rather than the global `<font face="Menlo" class="">LitConfig</font>` object?<div class=""><br class=""></div><div class="">The llvm-lit documentation makes the distinction between these two object here:</div><div class=""><br class=""></div><div class=""><a href="https://llvm.org/docs/CommandGuide/lit.html#test-suites" class="">https://llvm.org/docs/CommandGuide/lit.html#test-suites</a></div><div class=""><br class=""></div><div class="">I think this makes  more sense because whether or not `<font face="Menlo" class="">recursiveExpansionLimit</font>`  is needed is really a property of a particular test suite rather than a global property for all test suites. In particular its dependent on the substitutions which are part of the `<font face="Menlo" class="">TestingConfig</font>` objects not the global `<font face="Menlo" class="">LitConfig</font>` object.</div><div class=""><br class=""></div><div class="">Sorry I didn't catch this issue during code review.</div><div class=""><div class=""><br class=""></div><div class="">While I agree fixing the 8 tests in LLVM is a good idea I think the underlying issue is the design mistake we made in <a href="https://reviews.llvm.org/D76178" class="">https://reviews.llvm.org/D76178</a>.</div><div class=""><br class=""></div><div class="">If you agree with my assessment then  I suggest that you revert the libcxx patch and then come up with a patch for llvm-lit to move the `r<font face="Menlo" class="">ecursiveExpansionLimit</font>` property from the global `<font face="Menlo" class="">LitConfig</font>` object to `<font face="Menlo" class="">TestingConfig</font>`. Then a new version of the libcxx patch can be landed that does `<font face="Menlo" class="">config.recursiveExpansionLimit = <number></font>` rather than `<font face="Menlo" class="">lit_config.r</font><span style="caret-color: rgb(0, 0, 0);" class=""><font face="Menlo" class="">ecursiveExpansionLimit = <number></font>`.</span></div><div class=""><br class=""></div><div class=""><span style="caret-color: rgb(0, 0, 0);" class="">What do you think?</span></div></div></div></div></blockquote><div><br class=""></div><div>Thanks for your reply. So your opinion is that my proposed (2) is the right way forward. I still (weakly) think that we made the right design choice because whether to recursively expand or not seems like a property or the test suite as a whole, and not really something that you'd want to customize on a per-directory basis. It's kind of like the timeout time on tests or whether to be verbose.</div><div><br class=""></div><div>It seems to me like the root cause really is that we can modify the LitConfig globally from subdirectories. Consider for example the timeout time -- imagine what would happen if libc++ set the timeout time to e.g. 2 minutes because <reasons>. Then, imagine that the Clang config sets the timeout time to 10 seconds, because it doesn't make sense for Clang tests to take longer than that. In the current state of things, whichever lit.cfg file is processed last will win, which seems brittle. I believe we should either not share the global LitConfig instance (by copying it when we process subdirectories), or make it read-only after construction to make it clear that it shouldn't be modified. And if it was made read-only, then I agree it would make sense to move `recursiveExpansionLimit` to TestingConfig instead.</div><div><br class=""></div><div>What do you think?</div><div><br class=""></div><div>Louis</div><div><br class=""></div><div>P.S.: I don't know whether it's possible to make LitConfig actually read-only -- I'd be satisfied if we agreed on the design intent of it being read-only.</div><br class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class=""><div class=""><span style="caret-color: rgb(0, 0, 0);" class=""><br class=""></span></div><div class=""><span style="caret-color: rgb(0, 0, 0);" class="">Thanks,</span></div><div class=""><span style="caret-color: rgb(0, 0, 0);" class="">Dan.</span></div><div class=""><br class=""><blockquote type="cite" class=""><div class="">On 30 Mar 2020, at 06:21, Louis Dionne <<a href="mailto:ldionne@apple.com" class="">ldionne@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">+ Lit folks<br class=""><br class="">So I'm pretty sure this happens because the Lit Configuration is shared across all the test suites, which means that when I set `lit_config.recursiveExpansionLimit = 10`, it actually gets set for all the test suites, not only for libc++. And for some test suites, it's possible that recursive substitutions mess things up if they use non-delimited substitutions (e.g. %clang and %clang_cc1 would conflict).<br class=""><br class="">The problem appears to be that there's only one Lit Config shared across all test suites, whereas we make a deep copy of each local config when we enter a new subdirectory. Can some of the CC'd folks comment on whether we should<br class="">1. deep copy the Lit Config too for each subdirectory, or<br class="">2. move the recursiveExpansionLimit setting to the local config, or<br class="">3. make it so that `make check-all` does not try to run Lit in one go on all the test suites.<br class=""><br class="">Doing (2) seems weird to me, since I think `recursiveExpansionLimit` belongs to the Lit Config more than a local config, but I could be convinced.<br class=""><br class="">Whatever we agree on, I'll submit a patch.<br class=""><br class="">Cheers,<br class="">Louis<br class=""><br class=""><br class=""><br class=""><blockquote type="cite" class="">On Mar 29, 2020, at 21:04, David Zarzycki <<a href="mailto:dave@znu.io" class="">dave@znu.io</a>> wrote:<br class=""><br class="">Hi Louis,<br class=""><br class="">What I'm doing is essentially the documented "how to build LLVM". You can find it in the LLVM getting started guide. So yes, one big CMake setup as documented. If this setup is a surprise to you, then I need to revert this. Here is a reduction of my phased testing setup that demonstrates the regression:<br class=""><br class="">mkdir -p /tmp/x/y/z<br class="">cd /tmp/x/y/z<br class="">cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=FALSE -DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++ -DLLVM_ENABLE_PROJECTS="clang;lld;libcxxabi;libcxx" ~/s/lp/llvm<br class="">ninja all check-all<br class=""><br class="">Dave<br class=""><br class="">On Sun, Mar 29, 2020, at 12:36 PM, Louis Dionne wrote:<br class=""><blockquote type="cite" class="">Hi,<br class=""><br class="">Sorry, I just saw this. I'm looking at the failures and I have a really <br class="">hard time understanding how they could be related to a libc++ change, <br class="">let alone that one. Can you please share exactly how you're configuring <br class="">your LLVM tree? Do you have additional downstream patches that touch <br class="">the libc++ and/or libc++abi test suites?<br class=""><br class="">The one thing I could imagine is that somehow the <br class="">`lit_config.recursiveExpansionLimit` that we set in libc++'s lit.cfg is <br class="">being picked up in other lit configurations too, however I don't think <br class="">that really makes sense. It does seem like you have a single huge lit <br class="">test suite for all of LLVM given the output you provide below, where it <br class="">seems like libcxxabi, libcxx, clang & friends are all in the same CMake <br class="">target. How do you run your tests?<br class=""><br class="">Louis<br class=""><br class=""><blockquote type="cite" class="">On Mar 28, 2020, at 21:49, David Zarzycki <<a href="mailto:dave@znu.io" class="">dave@znu.io</a>> wrote:<br class=""><br class="">Hi Louis,<br class=""><br class="">Git bisecting has revealed that that this is breaking the first stage of my testing harness (Fedora 31, x86_64, release without assertions). I plan in reverting this but I want to give you a heads up first. Do you think you can find a quick fix?<br class=""><br class="">Dave<br class=""><br class=""><br class="">[0+1] Running all regression tests<br class="">llvm-lit: /home/dave/s/lp/libcxxabi/test/lit.cfg:58: note: Using configuration variant: libcxxabi<br class="">llvm-lit: /home/dave/s/lp/libcxx/utils/libcxx/test/config.py:322: note: inferred use_system_cxx_lib as: None<br class="">llvm-lit: /home/dave/s/lp/libcxx/utils/libcxx/test/config.py:349: note: inferred use_clang_verify as: True<br class="">llvm-lit: /home/dave/s/lp/libcxx/utils/libcxx/test/config.py:359: note: enabling thread-safety annotations<br class="">llvm-lit: /home/dave/s/lp/libcxx/utils/libcxx/test/config.py:542: note: inferred language dialect as: c++2a<br class="">llvm-lit: /home/dave/s/lp/libcxx/utils/libcxx/test/target_info.py:84: warning: The locale fr_FR.UTF-8 is not supported by your platform. Some tests will be unsupported.<br class="">llvm-lit: /home/dave/s/lp/libcxx/utils/libcxx/test/target_info.py:84: warning: The locale ru_RU.UTF-8 is not supported by your platform. Some tests will be unsupported.<br class="">llvm-lit: /home/dave/s/lp/libcxx/utils/libcxx/test/target_info.py:84: warning: The locale zh_CN.UTF-8 is not supported by your platform. Some tests will be unsupported.<br class="">llvm-lit: /home/dave/s/lp/libcxx/utils/libcxx/test/target_info.py:84: warning: The locale fr_CA.ISO8859-1 is not supported by your platform. Some tests will be unsupported.<br class="">llvm-lit: /home/dave/s/lp/libcxx/utils/libcxx/test/target_info.py:84: warning: The locale cs_CZ.ISO8859-2 is not supported by your platform. Some tests will be unsupported.<br class="">llvm-lit: /home/dave/s/lp/libcxx/utils/libcxx/test/config.py:438: note: inferred long_tests as: True<br class="">llvm-lit: /home/dave/s/lp/libcxx/utils/libcxx/test/config.py:158: note: Using compiler: /usr/bin/clang++<br class="">llvm-lit: /home/dave/s/lp/libcxx/utils/libcxx/test/config.py:159: note: Using flags: ['-v']<br class="">llvm-lit: /home/dave/s/lp/libcxx/utils/libcxx/test/config.py:164: note: Using compile flags: ['-Werror=thread-safety', '-DLIBCXXABI_NO_TIMER', '-D_LIBCPP_ENABLE_CXX17_REMOVED_UNEXPECTED_FUNCTIONS', '-funwind-tables', '-std=c++2a', '-nostdinc++', '-I/home/dave/s/lp/libcxx/include', '-I/home/dave/s/lp/libcxxabi/include', '-D__STDC_FORMAT_MACROS', '-D__STDC_LIMIT_MACROS', '-D__STDC_CONSTANT_MACROS', '-I/home/dave/s/lp/libcxx/test/support', '-ftemplate-depth=270', '-DLIBCXX_FILESYSTEM_STATIC_TEST_ROOT="/home/dave/s/lp/libcxx/test/std/input.output/filesystems/Inputs/static_test_env"', '-DLIBCXX_FILESYSTEM_DYNAMIC_TEST_ROOT="/tmp/_update_lc/r/projects/libcxxabi/test/filesystem/Output/dynamic_env"', '-DLIBCXX_FILESYSTEM_DYNAMIC_TEST_HELPER="/usr/bin/python /home/dave/s/lp/libcxx/test/support/filesystem_dynamic_test_helper.py"']<br class="">llvm-lit: /home/dave/s/lp/libcxx/utils/libcxx/test/config.py:166: note: Using warnings: ['-D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER', '-Wall', '-Wextra', '-Werror', '-Wuser-defined-warnings', '-Wshadow', '-Wno-unused-command-line-argument', '-Wno-attributes', '-Wno-pessimizing-move', '-Wno-c++11-extensions', '-Wno-user-defined-literals', '-Wno-noexcept-type', '-Wsign-compare', '-Wunused-variable', '-Wunused-parameter', '-Wunreachable-code']<br class="">llvm-lit: /home/dave/s/lp/libcxx/utils/libcxx/test/config.py:167: note: Using link flags: ['-L/tmp/_update_lc/r/./lib64', '-Wl,-rpath,/tmp/_update_lc/r/./lib64', '-L/tmp/_update_lc/r/./lib64', '-Wl,-rpath,/tmp/_update_lc/r/./lib64', '-nodefaultlibs', '/tmp/_update_lc/r/./lib64/libc++.a', '/tmp/_update_lc/r/./lib64/libc++abi.a', '-lm', '-lgcc_s', '-lgcc', '-lpthread', '-lrt', '-lc', '-lgcc_s', '-lgcc']<br class="">llvm-lit: /home/dave/s/lp/libcxx/utils/libcxx/test/config.py:170: note: Using available_features: ['thread-safety', 'libcxxabi-has-system-unwinder', 'c++2a', '-fsized-deallocation', 'libc++', 'clang', 'glibc-2.30', 'linux', 'fdelayed-template-parsing', 'glibc', 'modules-support', 'glibc-2', 'fcoroutines-ts', 'fedora', 'clang-9.0', 'clang-9', 'diagnose-if-support', 'fedora-31', 'clang-9.0.1', 'long_tests', '-faligned-allocation', 'locale.en_US.UTF-8', 'verify-support']<br class="">llvm-lit: /home/dave/s/lp/libcxx/utils/libcxx/test/config.py:175: note: Adding environment variables: {'LIBCXX_FILESYSTEM_DYNAMIC_TEST_ROOT': '/tmp/_update_lc/r/projects/libcxxabi/test/filesystem/Output/dynamic_env'}<br class="">llvm-lit: /home/dave/s/lp/libcxx/test/lit.cfg:46: note: Using configuration variant: libcxx<br class="">llvm-lit: /home/dave/s/lp/libcxx/utils/libcxx/test/config.py:322: note: inferred use_system_cxx_lib as: None<br class="">llvm-lit: /home/dave/s/lp/libcxx/utils/libcxx/test/config.py:349: note: inferred use_clang_verify as: True<br class="">llvm-lit: /home/dave/s/lp/libcxx/utils/libcxx/test/config.py:359: note: enabling thread-safety annotations<br class="">llvm-lit: /home/dave/s/lp/libcxx/utils/libcxx/test/config.py:542: note: inferred language dialect as: c++2a<br class="">llvm-lit: /home/dave/s/lp/libcxx/utils/libcxx/test/target_info.py:84: warning: The locale fr_FR.UTF-8 is not supported by your platform. Some tests will be unsupported.<br class="">llvm-lit: /home/dave/s/lp/libcxx/utils/libcxx/test/target_info.py:84: warning: The locale ru_RU.UTF-8 is not supported by your platform. Some tests will be unsupported.<br class="">llvm-lit: /home/dave/s/lp/libcxx/utils/libcxx/test/target_info.py:84: warning: The locale zh_CN.UTF-8 is not supported by your platform. Some tests will be unsupported.<br class="">llvm-lit: /home/dave/s/lp/libcxx/utils/libcxx/test/target_info.py:84: warning: The locale fr_CA.ISO8859-1 is not supported by your platform. Some tests will be unsupported.<br class="">llvm-lit: /home/dave/s/lp/libcxx/utils/libcxx/test/target_info.py:84: warning: The locale cs_CZ.ISO8859-2 is not supported by your platform. Some tests will be unsupported.<br class="">llvm-lit: /home/dave/s/lp/libcxx/utils/libcxx/test/config.py:438: note: inferred long_tests as: True<br class="">llvm-lit: /home/dave/s/lp/libcxx/utils/libcxx/test/config.py:158: note: Using compiler: /usr/bin/clang++<br class="">llvm-lit: /home/dave/s/lp/libcxx/utils/libcxx/test/config.py:159: note: Using flags: ['-v']<br class="">llvm-lit: /home/dave/s/lp/libcxx/utils/libcxx/test/config.py:164: note: Using compile flags: ['-Werror=thread-safety', '-std=c++2a', '-include', '/home/dave/s/lp/libcxx/test/support/nasty_macros.h', '-nostdinc++', '-I/home/dave/s/lp/libcxx/include', '-I/tmp/_update_lc/r/projects/libcxx/include/c++build', '-D__STDC_FORMAT_MACROS', '-D__STDC_LIMIT_MACROS', '-D__STDC_CONSTANT_MACROS', '-I/home/dave/s/lp/libcxx/test/support', '-ftemplate-depth=270', '-DLIBCXX_FILESYSTEM_STATIC_TEST_ROOT="/home/dave/s/lp/libcxx/test/std/input.output/filesystems/Inputs/static_test_env"', '-DLIBCXX_FILESYSTEM_DYNAMIC_TEST_ROOT="/tmp/_update_lc/r/projects/libcxx/test/filesystem/Output/dynamic_env"', '-DLIBCXX_FILESYSTEM_DYNAMIC_TEST_HELPER="/usr/bin/python /home/dave/s/lp/libcxx/test/support/filesystem_dynamic_test_helper.py"']<br class="">llvm-lit: /home/dave/s/lp/libcxx/utils/libcxx/test/config.py:166: note: Using warnings: ['-D_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER', '-Wall', '-Wextra', '-Werror', '-Wuser-defined-warnings', '-Wshadow', '-Wno-unused-command-line-argument', '-Wno-attributes', '-Wno-pessimizing-move', '-Wno-c++11-extensions', '-Wno-user-defined-literals', '-Wno-noexcept-type', '-Wsign-compare', '-Wunused-variable', '-Wunused-parameter', '-Wunreachable-code']<br class="">llvm-lit: /home/dave/s/lp/libcxx/utils/libcxx/test/config.py:167: note: Using link flags: ['-L/tmp/_update_lc/r/./lib64', '-Wl,-rpath,/tmp/_update_lc/r/./lib64', '-nodefaultlibs', '-lc++experimental', '/tmp/_update_lc/r/./lib64/libc++.a', '-lc++abi', '-lm', '-lgcc_s', '-lgcc', '-lpthread', '-lrt', '-lc', '-lgcc_s', '-lgcc']<br class="">llvm-lit: /home/dave/s/lp/libcxx/utils/libcxx/test/config.py:170: note: Using available_features: ['thread-safety', 'c++2a', '-fsized-deallocation', 'c++experimental', 'libc++', 'clang', 'libatomic', 'glibc-2.30', 'linux', 'fdelayed-template-parsing', 'glibc', 'modules-support', 'glibc-2', 'fcoroutines-ts', 'fedora', 'clang-9.0', 'clang-9', 'diagnose-if-support', 'fedora-31', 'clang-9.0.1', 'long_tests', '-faligned-allocation', 'locale.en_US.UTF-8', 'verify-support']<br class="">llvm-lit: /home/dave/s/lp/libcxx/utils/libcxx/test/config.py:175: note: Adding environment variables: {'LIBCXX_FILESYSTEM_DYNAMIC_TEST_ROOT': '/tmp/_update_lc/r/projects/libcxx/test/filesystem/Output/dynamic_env'}<br class="">llvm-lit: /home/dave/s/lp/llvm/utils/lit/lit/llvm/config.py:342: note: using clang: /tmp/_update_lc/r/bin/clang<br class="">llvm-lit: /home/dave/s/lp/llvm/utils/lit/lit/llvm/config.py:342: note: using ld.lld: /tmp/_update_lc/r/bin/ld.lld<br class="">llvm-lit: /home/dave/s/lp/llvm/utils/lit/lit/llvm/config.py:342: note: using lld-link: /tmp/_update_lc/r/bin/lld-link<br class="">llvm-lit: /home/dave/s/lp/llvm/utils/lit/lit/llvm/config.py:342: note: using ld64.lld: /tmp/_update_lc/r/bin/ld64.lld<br class="">llvm-lit: /home/dave/s/lp/llvm/utils/lit/lit/llvm/config.py:342: note: using wasm-ld: /tmp/_update_lc/r/bin/wasm-ld<br class="">FAIL: Clang :: Driver/cl-response-file.c (9973 of 62557)<br class="">******************** TEST 'Clang :: Driver/cl-response-file.c' FAILED ********************<br class="">Script:<br class="">--<br class="">: 'RUN: at line 7';   printf '/home/dave/s/lp/clang/test/Driver/cl-response-file.c\n' '/I/home/dave/s/lp/clang/test/Driver\Inputs\cl-response-file\ /DFOO=2' > /tmp/_update_lc/r/tools/clang/test/Driver/Output/cl-response-file.c.tmp.rsp<br class="">: 'RUN: at line 8';   /tmp/_update_lc/r/bin/clang --driver-mode=cl /c -### @/tmp/_update_lc/r/tools/clang/test/Driver/Output/cl-response-file.c.tmp.rsp -- /home/dave/s/lp/clang/test/Driver/cl-response-file.c 2>&1 | /tmp/_update_lc/r/bin/FileCheck /home/dave/s/lp/clang/test/Driver/cl-response-file.c<br class="">--<br class="">Exit Code: 1<br class=""><br class="">Command Output (stderr):<br class="">--<br class="">/home/dave/s/lp/clang/test/Driver/cl-response-file.c:10:11: error: CHECK: expected string not found in input<br class="">// CHECK: "-I" "{{.*}}\\Inputs\\cl-response-file\\" "-D" "FOO=2"<br class="">        ^<br class=""><stdin>:1:1: note: scanning from here<br class="">clang version 11.0.0 (<a href="https://github.com/llvm/llvm-project.git" class="">https://github.com/llvm/llvm-project.git</a> ba2e72c54ec998123ae1bc001cb782449fafc924)<br class="">^<br class=""><stdin>:5:1093: note: possible intended match here<br class="">"/tmp/_update_lc/r/bin/clang-11" "-cc1" "-triple" "x86_64-pc-windows-msvc19.11.0" "-emit-obj" "-mrelax-all" "-mincremental-linker-compatible" "-disable-free" "-disable-llvm-verifier" "-discard-value-names" "-main-file-name" "cl-response-file.c" "-mrelocation-model" "pic" "-pic-level" "2" "-mthread-model" "posix" "-mframe-pointer=none" "-relaxed-aliasing" "-fmath-errno" "-fno-rounding-math" "-masm-verbose" "-mconstructor-aliases" "-munwind-tables" "-target-cpu" "x86-64" "-mllvm" "-x86-asm-syntax=intel" "-D_MT" "-flto-visibility-public-std" "--dependent-lib=libcmt" "--dependent-lib=oldnames" "-stack-protector" "2" "-fms-volatile" "-fdiagnostics-format" "msvc" "-dwarf-column-info" "-resource-dir" "/tmp/_update_lc/r/lib64/clang/11.0.0" "-internal-isystem" "/tmp/_update_lc/r/lib64/clang/11.0.0/include" "-fdebug-compilation-dir" "/tmp/_update_lc/r/tools/clang/test/Driver" "-ferror-limit" "19" "-fmessage-length" "0" "-fno-use-cxa-atexit" "-fms-extensions" "-fms-compatibility" "-fms-compatibility-version=19.11" "-fdelayed-template-parsing" "-fobjc-runtime=gcc" "-fdiagnostics-show-option" "-faddrsig" "-o" "cl-response-file.obj" "-x" "c" "/home/dave/s/lp/clang/test/Driver/cl-response-file.c"<br class="">                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  ^<br class=""><br class="">--<br class=""><br class="">********************<br class="">FAIL: LLVM :: Linker/2003-01-30-LinkerTypeRename.ll (40196 of 62557)<br class="">******************** TEST 'LLVM :: Linker/2003-01-30-LinkerTypeRename.ll' FAILED ********************<br class="">Script:<br class="">--<br class="">: 'RUN: at line 4';   echo "/tmp/_update_lc/r/test/Linker/Outputy = type opaque @GV = external global /tmp/_update_lc/r/test/Linker/Outputy*" | /tmp/_update_lc/r/bin/llvm-as > /tmp/_update_lc/r/test/Linker/Output/2003-01-30-LinkerTypeRename.ll.tmp.1.bc<br class="">: 'RUN: at line 5';   /tmp/_update_lc/r/bin/llvm-as < /home/dave/s/lp/llvm/test/Linker/2003-01-30-LinkerTypeRename.ll > /tmp/_update_lc/r/test/Linker/Output/2003-01-30-LinkerTypeRename.ll.tmp.2.bc<br class="">: 'RUN: at line 6';   /tmp/_update_lc/r/bin/llvm-link /tmp/_update_lc/r/test/Linker/Output/2003-01-30-LinkerTypeRename.ll.tmp.1.bc /tmp/_update_lc/r/test/Linker/Output/2003-01-30-LinkerTypeRename.ll.tmp.2.bc -S | /tmp/_update_lc/r/bin/FileCheck /home/dave/s/lp/llvm/test/Linker/2003-01-30-LinkerTypeRename.ll<br class="">--<br class="">Exit Code: 1<br class=""><br class="">Command Output (stderr):<br class="">--<br class="">/tmp/_update_lc/r/bin/llvm-as: <stdin>:1:1: error: expected top-level entity<br class="">/tmp/_update_lc/r/test/Linker/Outputy = type opaque @GV = external global /tmp/_update_lc/r/test/Linker/Outputy*<br class="">^<br class=""><br class="">--<br class=""><br class="">********************<br class="">FAIL: LLVM :: Linker/2003-06-02-TypeResolveProblem2.ll (40198 of 62557)<br class="">******************** TEST 'LLVM :: Linker/2003-06-02-TypeResolveProblem2.ll' FAILED ********************<br class="">Script:<br class="">--<br class="">: 'RUN: at line 1';   echo "/tmp/_update_lc/r/test/Linker/Output = type i32" | /tmp/_update_lc/r/bin/llvm-as > /tmp/_update_lc/r/test/Linker/Output/2003-06-02-TypeResolveProblem2.ll.tmp.1.bc<br class="">: 'RUN: at line 2';   /tmp/_update_lc/r/bin/llvm-as < /home/dave/s/lp/llvm/test/Linker/2003-06-02-TypeResolveProblem2.ll > /tmp/_update_lc/r/test/Linker/Output/2003-06-02-TypeResolveProblem2.ll.tmp.2.bc<br class="">: 'RUN: at line 3';   /tmp/_update_lc/r/bin/llvm-link /tmp/_update_lc/r/test/Linker/Output/2003-06-02-TypeResolveProblem2.ll.tmp.1.bc /tmp/_update_lc/r/test/Linker/Output/2003-06-02-TypeResolveProblem2.ll.tmp.2.bc<br class="">--<br class="">Exit Code: 1<br class=""><br class="">Command Output (stderr):<br class="">--<br class="">/tmp/_update_lc/r/bin/llvm-as: <stdin>:1:1: error: expected top-level entity<br class="">/tmp/_update_lc/r/test/Linker/Output = type i32<br class="">^<br class=""><br class="">--<br class=""><br class="">********************<br class="">FAIL: LLVM :: Linker/2003-04-26-NullPtrLinkProblem.ll (40204 of 62557)<br class="">******************** TEST 'LLVM :: Linker/2003-04-26-NullPtrLinkProblem.ll' FAILED ********************<br class="">Script:<br class="">--<br class="">: 'RUN: at line 7';   printf "\x00" >> /tmp/_update_lc/r/test/tools/sanstats/Output/elf.test.tmp.stats<br class="">: 'RUN: at line 8';   printf "\x01\x00\x00\x00\x01\x00\x00\x00" >> /tmp/_update_lc/r/test/tools/sanstats/Output/elf.test.tmp.stats<br class="">: 'RUN: at line 9';   printf "\x11\x00\x00\x00\x02\x00\x00\x20" >> /tmp/_update_lc/r/test/tools/sanstats/Output/elf.test.tmp.stats<br class="">: 'RUN: at line 10';   printf "\x21\x00\x00\x00\x03\x00\x00\x40" >> /tmp/_update_lc/r/test/tools/sanstats/Output/elf.test.tmp.stats<br class="">: 'RUN: at line 11';   printf "\x01\x00\x00\x00\x04\x00\x00\x60" >> /tmp/_update_lc/r/test/tools/sanstats/Output/elf.test.tmp.stats<br class="">: 'RUN: at line 12';   printf "\x11\x00\x00\x00\x05\x00\x00\x80" >> /tmp/_update_lc/r/test/tools/sanstats/Output/elf.test.tmp.stats<br class="">: 'RUN: at line 13';   printf "\x21\x00\x00\x00\x06\x00\x00\xa0" >> /tmp/_update_lc/r/test/tools/sanstats/Output/elf.test.tmp.stats<br class="">: 'RUN: at line 14';   printf "\x00\x00\x00\x00\x00\x00\x00\x00" >> /tmp/_update_lc/r/test/tools/sanstats/Output/elf.test.tmp.stats<br class="">: 'RUN: at line 16';   printf "/home/dave/s/lp/llvm/test/tools/sanstats/elf.test" "/tmp/_update_lc/r/test/tools/sanstats/Output/elf.test.tmp2.o" >> /tmp/_update_lc/r/test/tools/sanstats/Output/elf.test.tmp.stats<br class="">: 'RUN: at line 17';   printf "\x00" >> /tmp/_update_lc/r/test/tools/sanstats/Output/elf.test.tmp.stats<br class="">: 'RUN: at line 18';   printf "\x21\x00\x00\x00\x07\x00\x00\x00" >> /tmp/_update_lc/r/test/tools/sanstats/Output/elf.test.tmp.stats<br class="">: 'RUN: at line 19';   printf "\x11\x00\x00\x00\x08\x00\x00\x20" >> /tmp/_update_lc/r/test/tools/sanstats/Output/elf.test.tmp.stats<br class="">: 'RUN: at line 20';   printf "\x01\x00\x00\x00\x09\x00\x00\x40" >> /tmp/_update_lc/r/test/tools/sanstats/Output/elf.test.tmp.stats<br class="">: 'RUN: at line 21';   printf "\x21\x00\x00\x00\x0b\x00\x00\x60" >> /tmp/_update_lc/r/test/tools/sanstats/Output/elf.test.tmp.stats<br class="">: 'RUN: at line 22';   printf "\x11\x00\x00\x00\x0c\x00\x00\x80" >> /tmp/_update_lc/r/test/tools/sanstats/Output/elf.test.tmp.stats<br class="">: 'RUN: at line 23';   printf "\x01\x00\x00\x00\x0e\x00\x00\xa0" >> /tmp/_update_lc/r/test/tools/sanstats/Output/elf.test.tmp.stats<br class="">: 'RUN: at line 24';   printf "\x00\x00\x00\x00\x00\x00\x00\x00" >> /tmp/_update_lc/r/test/tools/sanstats/Output/elf.test.tmp.stats<br class="">: 'RUN: at line 26';   /tmp/_update_lc/r/bin/sanstats /tmp/_update_lc/r/test/tools/sanstats/Output/elf.test.tmp.stats | /tmp/_update_lc/r/bin/FileCheck /home/dave/s/lp/llvm/test/tools/sanstats/elf.test<br class="">: 'RUN: at line 30';   mkdir -p /tmp/_update_lc/r/test/tools/sanstats/Output/elf.test.tmp.dir<br class="">: 'RUN: at line 31';   mv -f /tmp/_update_lc/r/test/tools/sanstats/Output/elf.test.tmp1.o /tmp/_update_lc/r/test/tools/sanstats/Output/elf.test.tmp2.o /tmp/_update_lc/r/test/tools/sanstats/Output/elf.test.tmp.dir<br class="">: 'RUN: at line 32';   /tmp/_update_lc/r/bin/sanstats /tmp/_update_lc/r/test/tools/sanstats/Output/elf.test.tmp.stats | /tmp/_update_lc/r/bin/FileCheck /home/dave/s/lp/llvm/test/tools/sanstats/elf.test --check-prefix=INVALID<br class="">: 'RUN: at line 33';   mv -f /tmp/_update_lc/r/test/tools/sanstats/Output/elf.test.tmp.stats /tmp/_update_lc/r/test/tools/sanstats/Output/elf.test.tmp.dir/copy.stats<br class="">: 'RUN: at line 34';   cd /tmp/_update_lc/r/test/tools/sanstats/Output/elf.test.tmp.dir && /tmp/_update_lc/r/bin/sanstats copy.stats | /tmp/_update_lc/r/bin/FileCheck /home/dave/s/lp/llvm/test/tools/sanstats/elf.test<br class="">--<br class="">Exit Code: 1<br class=""><br class="">Command Output (stderr):<br class="">--<br class="">/home/dave/s/lp/llvm/test/tools/sanstats/elf.test:38:10: error: CHECK: expected string not found in input<br class=""># CHECK: 0x0000000000000000 /tmp{{[/\\]}}f.c:1 f1 cfi-vcall 1<br class="">       ^<br class=""><stdin>:1:1: note: scanning from here<br class=""><error> The file was not recognized as a valid object file<br class="">^<br class=""><stdin>:6:1: note: possible intended match here<br class="">0x0000000000000010 <invalid>:0 <invalid> cfi-icall 5<br class="">^<br class=""><br class="">--<br class=""><br class="">********************<br class="">Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90..<br class=""><br class="">10 warning(s) in tests<br class=""><br class="">Testing Time: 148.87s<br class="">********************<br class="">Failing Tests (8):<br class="">  Clang :: Driver/cl-response-file.c<br class="">  LLVM :: Linker/2003-01-30-LinkerTypeRename.ll<br class="">  LLVM :: Linker/2003-04-26-NullPtrLinkProblem.ll<br class="">  LLVM :: Linker/2003-06-02-TypeResolveProblem.ll<br class="">  LLVM :: Linker/2003-06-02-TypeResolveProblem2.ll<br class="">  LLVM :: Linker/2003-08-23-GlobalVarLinking.ll<br class="">  LLVM :: Linker/2003-11-18-TypeResolution.ll<br class="">  LLVM :: tools/sanstats/elf.test<br class=""><br class="">Expected Passes    : 45131<br class="">Expected Failures  : 114<br class="">Unsupported Tests  : 17282<br class="">Unexpected Failures: 8<br class="">FAILED: CMakeFiles/check-all<br class=""><br class=""><br class=""><br class=""><br class="">On Fri, Mar 27, 2020, at 11:09 AM, Louis Dionne via libcxx-commits wrote:<br class=""><blockquote type="cite" class=""><br class="">Author: Louis Dionne<br class="">Date: 2020-03-27T11:09:08-04:00<br class="">New Revision: cd7f9751c30092033a5e97591876f972daf61989<br class=""><br class="">URL: <br class=""><a href="https://github.com/llvm/llvm-project/commit/cd7f9751c30092033a5e97591876f972daf61989" class="">https://github.com/llvm/llvm-project/commit/cd7f9751c30092033a5e97591876f972daf61989</a><br class="">DIFF: <br class=""><a href="https://github.com/llvm/llvm-project/commit/cd7f9751c30092033a5e97591876f972daf61989.diff" class="">https://github.com/llvm/llvm-project/commit/cd7f9751c30092033a5e97591876f972daf61989.diff</a><br class=""><br class="">LOG: [libc++] NFC: Simplify substitutions by using lit recursive substitutions<br class=""><br class="">Since lit supports expanding substitutions recursively, we can define<br class="">substitutions in terms of other substitutions. This allows us to simplify<br class="">how libc++ substitutions are defined.<br class=""><br class="">This doesn't change the substitutions at all, it only makes them simpler<br class="">to define.<br class=""><br class="">Added: <br class=""><br class=""><br class="">Modified: <br class="">  libcxx/test/lit.cfg<br class="">  libcxx/utils/libcxx/test/config.py<br class="">  libcxx/utils/libcxx/test/format.py<br class=""><br class="">Removed: <br class=""><br class=""><br class=""><br class="">################################################################################<br class="">diff  --git a/libcxx/test/lit.cfg b/libcxx/test/lit.cfg<br class="">index ed5aa29d9175..e6e0542c2fbe 100644<br class="">--- a/libcxx/test/lit.cfg<br class="">+++ b/libcxx/test/lit.cfg<br class="">@@ -53,3 +53,5 @@ configuration = <br class="">config_module.Configuration(lit_config, config)<br class="">configuration.configure()<br class="">configuration.print_config_info()<br class="">config.test_format = configuration.get_test_format()<br class="">+<br class="">+lit_config.recursiveExpansionLimit = 10<br class=""><br class="">diff  --git a/libcxx/utils/libcxx/test/config.py <br class="">b/libcxx/utils/libcxx/test/config.py<br class="">index 2d0c3deadbc3..66e60cd75cf3 100644<br class="">--- a/libcxx/utils/libcxx/test/config.py<br class="">+++ b/libcxx/utils/libcxx/test/config.py<br class="">@@ -1039,35 +1039,26 @@ def configure_substitutions(self):<br class="">       if self.target_info.is_darwin():<br class="">           # Do not pass DYLD_LIBRARY_PATH to the compiler, linker, <br class="">etc. as<br class="">           # these tools are not meant to exercise the just-built <br class="">libraries.<br class="">-            tool_env += 'env DYLD_LIBRARY_PATH="" '<br class="">+            tool_env += 'env DYLD_LIBRARY_PATH=""'<br class=""><br class="">       sub = self.config.substitutions<br class="">-        cxx_path = tool_env + pipes.quote(self.cxx.path)<br class="">       # Configure compiler substitutions<br class="">-        sub.append(('%{cxx}', cxx_path))<br class="">+        sub.append(('%{cxx}', '{} {}'.format(tool_env, <br class="">pipes.quote(self.cxx.path))))<br class="">       sub.append(('%{libcxx_src_root}', self.libcxx_src_root))<br class="">       # Configure flags substitutions<br class="">-        flags_str = ' '.join([pipes.quote(f) for f in self.cxx.flags])<br class="">-        compile_flags_str = ' '.join([pipes.quote(f) for f in <br class="">self.cxx.compile_flags])<br class="">-        link_flags_str = ' '.join([pipes.quote(f) for f in <br class="">self.cxx.link_flags])<br class="">-        all_flags = '%s %s %s' % (flags_str, compile_flags_str, <br class="">link_flags_str)<br class="">-        sub.append(('%{flags}', flags_str))<br class="">-        sub.append(('%{compile_flags}', compile_flags_str))<br class="">-        sub.append(('%{link_flags}', link_flags_str))<br class="">+        sub.append(('%{flags}',         ' '.join(map(pipes.quote, <br class="">self.cxx.flags))))<br class="">+        sub.append(('%{compile_flags}', ' '.join(map(pipes.quote, <br class="">self.cxx.compile_flags))))<br class="">+        sub.append(('%{link_flags}',    ' '.join(map(pipes.quote, <br class="">self.cxx.link_flags))))<br class="">       if self.cxx.isVerifySupported():<br class="">-            verify_str = ' ' + ' '.join(self.cxx.verify_flags) + ' '<br class="">-            sub.append(('%{verify}', verify_str))<br class="">-        # Add compile and link shortcuts<br class="">-        compile_str = (cxx_path + ' -o %t.o %s -c ' + flags_str<br class="">-                       + ' ' + compile_flags_str)<br class="">-        build_str = cxx_path + ' -o %t.exe %s ' + all_flags<br class="">+            sub.append(('%{verify}', ' '.join(self.cxx.verify_flags)))<br class="">+        # Add compile and build shortcuts<br class="">+        sub.append(('%{compile}', '%{cxx} -o %t.o %s -c %{flags} <br class="">%{compile_flags}'))<br class="">+        sub.append(('%{build}',   '%{cxx} -o %t.exe %s %{flags} <br class="">%{compile_flags} %{link_flags}'))<br class="">       if self.cxx.use_modules:<br class="">-            sub.append(('%{build_module}', build_str))<br class="">+            sub.append(('%{build_module}', '%{build}'))<br class="">       elif self.cxx.modules_flags is not None:<br class="">-            modules_str = ' '.join(self.cxx.modules_flags) + ' '<br class="">-            sub.append(('%{build_module}', build_str + ' ' + <br class="">modules_str))<br class="">-        sub.append(('%{compile}', compile_str))<br class="">-        sub.append(('%{build}', build_str))<br class="">+            sub.append(('%{build_module}', '%{{build}} {}'.format(' <br class="">'.join(self.cxx.modules_flags))))<br class="">+<br class="">       # Configure exec prefix substitutions.<br class="">       # Configure run env substitution.<br class="">       codesign_ident = self.get_lit_conf('llvm_codesign_identity', <br class="">'')<br class="">@@ -1077,13 +1068,11 @@ def configure_substitutions(self):<br class="">                 '--dependencies %%file_dependencies --env %s -- ' %  <br class="">\<br class="">           (pipes.quote(sys.executable), pipes.quote(run_py),<br class="">            codesign_ident, env_vars)<br class="">-        run_str = exec_str + '%t.exe'<br class="">       sub.append(('%{exec}', exec_str))<br class="">-        sub.append(('%{run}', run_str))<br class="">+        sub.append(('%{run}', '%{exec} %t.exe'))<br class="">       # Configure not program substitutions<br class="">       not_py = os.path.join(self.libcxx_src_root, 'utils', 'not.py')<br class="">-        not_str = '%s %s ' % (pipes.quote(sys.executable), <br class="">pipes.quote(not_py))<br class="">-        sub.append(('%{not} ', not_str))<br class="">+        sub.append(('%{not}', '{} <br class="">{}'.format(pipes.quote(sys.executable), pipes.quote(not_py))))<br class="">       if self.get_lit_conf('libcxx_gdb'):<br class="">           sub.append(('%{libcxx_gdb}', <br class="">self.get_lit_conf('libcxx_gdb')))<br class=""><br class=""><br class="">diff  --git a/libcxx/utils/libcxx/test/format.py <br class="">b/libcxx/utils/libcxx/test/format.py<br class="">index 2776af182f71..b5046aba1ca4 100644<br class="">--- a/libcxx/utils/libcxx/test/format.py<br class="">+++ b/libcxx/utils/libcxx/test/format.py<br class="">@@ -124,7 +124,8 @@ def _execute(self, test, lit_config):<br class="">       substitutions = lit.TestRunner.getDefaultSubstitutions(test, <br class="">tmpDir,<br class="">                                                              tmpBase)<br class="">       substitutions.append(('%file_dependencies', ' <br class="">'.join(data_files)))<br class="">-        script = lit.TestRunner.applySubstitutions(script, <br class="">substitutions)<br class="">+        script = lit.TestRunner.applySubstitutions(script, <br class="">substitutions,<br class="">+                                                   <br class="">recursion_limit=lit_config.recursiveExpansionLimit)<br class=""><br class="">       test_cxx = copy.deepcopy(self.cxx)<br class="">       if is_fail_test:<br class=""><br class=""><br class=""><br class="">_______________________________________________<br class="">libcxx-commits mailing list<br class="">libcxx-commits@lists.llvm.org<br class="">https://lists.llvm.org/cgi-bin/mailman/listinfo/libcxx-commits<br class=""><br class=""></blockquote></blockquote><br class=""><br class=""></blockquote></blockquote><br class=""></div></div></blockquote></div><br class=""></div></div></div></blockquote></div><br class=""></body></html>