[libcxx-commits] [libcxx] cd7f975 - [libc++] NFC: Simplify substitutions by using lit recursive substitutions

Reid Kleckner via libcxx-commits libcxx-commits at lists.llvm.org
Mon Mar 30 11:00:22 PDT 2020


The forwarded messages suggest that recursive substitution expansion is
only a problem for 8 tests in all of LLVM. I wasn't able to work out which
substitutions are causing the issue. I think %clang and %clang_cc1 can
coexist, because they are (or should be) regexes: `\b%clang\b`, which does
not match `%clang_cc1`.

I guess I'd hesitate to mess too much with the config. If we can get by
with one object, that seems better.

On Mon, Mar 30, 2020 at 6:21 AM Louis Dionne <ldionne at apple.com> wrote:

> + Lit folks
>
> 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).
>
> 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
> 1. deep copy the Lit Config too for each subdirectory, or
> 2. move the recursiveExpansionLimit setting to the local config, or
> 3. make it so that `make check-all` does not try to run Lit in one go on
> all the test suites.
>
> 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.
>
> Whatever we agree on, I'll submit a patch.
>
> Cheers,
> Louis
>
>
>
> > On Mar 29, 2020, at 21:04, David Zarzycki <dave at znu.io> wrote:
> >
> > Hi Louis,
> >
> > 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:
> >
> > mkdir -p /tmp/x/y/z
> > cd /tmp/x/y/z
> > 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
> > ninja all check-all
> >
> > Dave
> >
> > On Sun, Mar 29, 2020, at 12:36 PM, Louis Dionne wrote:
> >> Hi,
> >>
> >> Sorry, I just saw this. I'm looking at the failures and I have a really
> >> hard time understanding how they could be related to a libc++ change,
> >> let alone that one. Can you please share exactly how you're configuring
> >> your LLVM tree? Do you have additional downstream patches that touch
> >> the libc++ and/or libc++abi test suites?
> >>
> >> The one thing I could imagine is that somehow the
> >> `lit_config.recursiveExpansionLimit` that we set in libc++'s lit.cfg is
> >> being picked up in other lit configurations too, however I don't think
> >> that really makes sense. It does seem like you have a single huge lit
> >> test suite for all of LLVM given the output you provide below, where it
> >> seems like libcxxabi, libcxx, clang & friends are all in the same CMake
> >> target. How do you run your tests?
> >>
> >> Louis
> >>
> >>> On Mar 28, 2020, at 21:49, David Zarzycki <dave at znu.io> wrote:
> >>>
> >>> Hi Louis,
> >>>
> >>> 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?
> >>>
> >>> Dave
> >>>
> >>>
> >>> [0+1] Running all regression tests
> >>> llvm-lit: /home/dave/s/lp/libcxxabi/test/lit.cfg:58: note: Using
> configuration variant: libcxxabi
> >>> llvm-lit: /home/dave/s/lp/libcxx/utils/libcxx/test/config.py:322:
> note: inferred use_system_cxx_lib as: None
> >>> llvm-lit: /home/dave/s/lp/libcxx/utils/libcxx/test/config.py:349:
> note: inferred use_clang_verify as: True
> >>> llvm-lit: /home/dave/s/lp/libcxx/utils/libcxx/test/config.py:359:
> note: enabling thread-safety annotations
> >>> llvm-lit: /home/dave/s/lp/libcxx/utils/libcxx/test/config.py:542:
> note: inferred language dialect as: c++2a
> >>> 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.
> >>> 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.
> >>> 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.
> >>> 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.
> >>> 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.
> >>> llvm-lit: /home/dave/s/lp/libcxx/utils/libcxx/test/config.py:438:
> note: inferred long_tests as: True
> >>> llvm-lit: /home/dave/s/lp/libcxx/utils/libcxx/test/config.py:158:
> note: Using compiler: /usr/bin/clang++
> >>> llvm-lit: /home/dave/s/lp/libcxx/utils/libcxx/test/config.py:159:
> note: Using flags: ['-v']
> >>> 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"']
> >>> 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']
> >>> 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']
> >>> 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']
> >>> 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'}
> >>> llvm-lit: /home/dave/s/lp/libcxx/test/lit.cfg:46: note: Using
> configuration variant: libcxx
> >>> llvm-lit: /home/dave/s/lp/libcxx/utils/libcxx/test/config.py:322:
> note: inferred use_system_cxx_lib as: None
> >>> llvm-lit: /home/dave/s/lp/libcxx/utils/libcxx/test/config.py:349:
> note: inferred use_clang_verify as: True
> >>> llvm-lit: /home/dave/s/lp/libcxx/utils/libcxx/test/config.py:359:
> note: enabling thread-safety annotations
> >>> llvm-lit: /home/dave/s/lp/libcxx/utils/libcxx/test/config.py:542:
> note: inferred language dialect as: c++2a
> >>> 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.
> >>> 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.
> >>> 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.
> >>> 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.
> >>> 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.
> >>> llvm-lit: /home/dave/s/lp/libcxx/utils/libcxx/test/config.py:438:
> note: inferred long_tests as: True
> >>> llvm-lit: /home/dave/s/lp/libcxx/utils/libcxx/test/config.py:158:
> note: Using compiler: /usr/bin/clang++
> >>> llvm-lit: /home/dave/s/lp/libcxx/utils/libcxx/test/config.py:159:
> note: Using flags: ['-v']
> >>> 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"']
> >>> 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']
> >>> 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']
> >>> 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']
> >>> 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'}
> >>> llvm-lit: /home/dave/s/lp/llvm/utils/lit/lit/llvm/config.py:342: note:
> using clang: /tmp/_update_lc/r/bin/clang
> >>> 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
> >>> 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
> >>> 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
> >>> 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
> >>> FAIL: Clang :: Driver/cl-response-file.c (9973 of 62557)
> >>> ******************** TEST 'Clang :: Driver/cl-response-file.c' FAILED
> ********************
> >>> Script:
> >>> --
> >>> : '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
> >>> : '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
> >>> --
> >>> Exit Code: 1
> >>>
> >>> Command Output (stderr):
> >>> --
> >>> /home/dave/s/lp/clang/test/Driver/cl-response-file.c:10:11: error:
> CHECK: expected string not found in input
> >>> // CHECK: "-I" "{{.*}}\\Inputs\\cl-response-file\\" "-D" "FOO=2"
> >>>         ^
> >>> <stdin>:1:1: note: scanning from here
> >>> clang version 11.0.0 (https://github.com/llvm/llvm-project.git
> ba2e72c54ec998123ae1bc001cb782449fafc924)
> >>> ^
> >>> <stdin>:5:1093: note: possible intended match here
> >>> "/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"
> >>>
>
>
>
>
>
>
>
>
>
>
>
>
>
>                                ^
> >>>
> >>> --
> >>>
> >>> ********************
> >>> FAIL: LLVM :: Linker/2003-01-30-LinkerTypeRename.ll (40196 of 62557)
> >>> ******************** TEST 'LLVM ::
> Linker/2003-01-30-LinkerTypeRename.ll' FAILED ********************
> >>> Script:
> >>> --
> >>> : '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
> >>> : '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
> >>> : '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
> >>> --
> >>> Exit Code: 1
> >>>
> >>> Command Output (stderr):
> >>> --
> >>> /tmp/_update_lc/r/bin/llvm-as: <stdin>:1:1: error: expected top-level
> entity
> >>> /tmp/_update_lc/r/test/Linker/Outputy = type opaque @GV = external
> global /tmp/_update_lc/r/test/Linker/Outputy*
> >>> ^
> >>>
> >>> --
> >>>
> >>> ********************
> >>> FAIL: LLVM :: Linker/2003-06-02-TypeResolveProblem2.ll (40198 of 62557)
> >>> ******************** TEST 'LLVM ::
> Linker/2003-06-02-TypeResolveProblem2.ll' FAILED ********************
> >>> Script:
> >>> --
> >>> : '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
> >>> : '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
> >>> : '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
> >>> --
> >>> Exit Code: 1
> >>>
> >>> Command Output (stderr):
> >>> --
> >>> /tmp/_update_lc/r/bin/llvm-as: <stdin>:1:1: error: expected top-level
> entity
> >>> /tmp/_update_lc/r/test/Linker/Output = type i32
> >>> ^
> >>>
> >>> --
> >>>
> >>> ********************
> >>> FAIL: LLVM :: Linker/2003-04-26-NullPtrLinkProblem.ll (40204 of 62557)
> >>> ******************** TEST 'LLVM ::
> Linker/2003-04-26-NullPtrLinkProblem.ll' FAILED ********************
> >>> Script:
> >>> --
> >>> : 'RUN: at line 7';   printf "\x00" >>
> /tmp/_update_lc/r/test/tools/sanstats/Output/elf.test.tmp.stats
> >>> : '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
> >>> : '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
> >>> : '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
> >>> : '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
> >>> : '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
> >>> : '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
> >>> : '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
> >>> : '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
> >>> : 'RUN: at line 17';   printf "\x00" >>
> /tmp/_update_lc/r/test/tools/sanstats/Output/elf.test.tmp.stats
> >>> : '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
> >>> : '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
> >>> : '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
> >>> : '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
> >>> : '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
> >>> : '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
> >>> : '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
> >>> : '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
> >>> : 'RUN: at line 30';   mkdir -p
> /tmp/_update_lc/r/test/tools/sanstats/Output/elf.test.tmp.dir
> >>> : '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
> >>> : '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
> >>> : '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
> >>> : '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
> >>> --
> >>> Exit Code: 1
> >>>
> >>> Command Output (stderr):
> >>> --
> >>> /home/dave/s/lp/llvm/test/tools/sanstats/elf.test:38:10: error: CHECK:
> expected string not found in input
> >>> # CHECK: 0x0000000000000000 /tmp{{[/\\]}}f.c:1 f1 cfi-vcall 1
> >>>        ^
> >>> <stdin>:1:1: note: scanning from here
> >>> <error> The file was not recognized as a valid object file
> >>> ^
> >>> <stdin>:6:1: note: possible intended match here
> >>> 0x0000000000000010 <invalid>:0 <invalid> cfi-icall 5
> >>> ^
> >>>
> >>> --
> >>>
> >>> ********************
> >>> Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90..
> >>>
> >>> 10 warning(s) in tests
> >>>
> >>> Testing Time: 148.87s
> >>> ********************
> >>> Failing Tests (8):
> >>>   Clang :: Driver/cl-response-file.c
> >>>   LLVM :: Linker/2003-01-30-LinkerTypeRename.ll
> >>>   LLVM :: Linker/2003-04-26-NullPtrLinkProblem.ll
> >>>   LLVM :: Linker/2003-06-02-TypeResolveProblem.ll
> >>>   LLVM :: Linker/2003-06-02-TypeResolveProblem2.ll
> >>>   LLVM :: Linker/2003-08-23-GlobalVarLinking.ll
> >>>   LLVM :: Linker/2003-11-18-TypeResolution.ll
> >>>   LLVM :: tools/sanstats/elf.test
> >>>
> >>> Expected Passes    : 45131
> >>> Expected Failures  : 114
> >>> Unsupported Tests  : 17282
> >>> Unexpected Failures: 8
> >>> FAILED: CMakeFiles/check-all
> >>>
> >>>
> >>>
> >>>
> >>> On Fri, Mar 27, 2020, at 11:09 AM, Louis Dionne via libcxx-commits
> wrote:
> >>>>
> >>>> Author: Louis Dionne
> >>>> Date: 2020-03-27T11:09:08-04:00
> >>>> New Revision: cd7f9751c30092033a5e97591876f972daf61989
> >>>>
> >>>> URL:
> >>>>
> https://github.com/llvm/llvm-project/commit/cd7f9751c30092033a5e97591876f972daf61989
> >>>> DIFF:
> >>>>
> https://github.com/llvm/llvm-project/commit/cd7f9751c30092033a5e97591876f972daf61989.diff
> >>>>
> >>>> LOG: [libc++] NFC: Simplify substitutions by using lit recursive
> substitutions
> >>>>
> >>>> Since lit supports expanding substitutions recursively, we can define
> >>>> substitutions in terms of other substitutions. This allows us to
> simplify
> >>>> how libc++ substitutions are defined.
> >>>>
> >>>> This doesn't change the substitutions at all, it only makes them
> simpler
> >>>> to define.
> >>>>
> >>>> Added:
> >>>>
> >>>>
> >>>> Modified:
> >>>>   libcxx/test/lit.cfg
> >>>>   libcxx/utils/libcxx/test/config.py
> >>>>   libcxx/utils/libcxx/test/format.py
> >>>>
> >>>> Removed:
> >>>>
> >>>>
> >>>>
> >>>>
> ################################################################################
> >>>> diff  --git a/libcxx/test/lit.cfg b/libcxx/test/lit.cfg
> >>>> index ed5aa29d9175..e6e0542c2fbe 100644
> >>>> --- a/libcxx/test/lit.cfg
> >>>> +++ b/libcxx/test/lit.cfg
> >>>> @@ -53,3 +53,5 @@ configuration =
> >>>> config_module.Configuration(lit_config, config)
> >>>> configuration.configure()
> >>>> configuration.print_config_info()
> >>>> config.test_format = configuration.get_test_format()
> >>>> +
> >>>> +lit_config.recursiveExpansionLimit = 10
> >>>>
> >>>> diff  --git a/libcxx/utils/libcxx/test/config.py
> >>>> b/libcxx/utils/libcxx/test/config.py
> >>>> index 2d0c3deadbc3..66e60cd75cf3 100644
> >>>> --- a/libcxx/utils/libcxx/test/config.py
> >>>> +++ b/libcxx/utils/libcxx/test/config.py
> >>>> @@ -1039,35 +1039,26 @@ def configure_substitutions(self):
> >>>>        if self.target_info.is_darwin():
> >>>>            # Do not pass DYLD_LIBRARY_PATH to the compiler, linker,
> >>>> etc. as
> >>>>            # these tools are not meant to exercise the just-built
> >>>> libraries.
> >>>> -            tool_env += 'env DYLD_LIBRARY_PATH="" '
> >>>> +            tool_env += 'env DYLD_LIBRARY_PATH=""'
> >>>>
> >>>>        sub = self.config.substitutions
> >>>> -        cxx_path = tool_env + pipes.quote(self.cxx.path)
> >>>>        # Configure compiler substitutions
> >>>> -        sub.append(('%{cxx}', cxx_path))
> >>>> +        sub.append(('%{cxx}', '{} {}'.format(tool_env,
> >>>> pipes.quote(self.cxx.path))))
> >>>>        sub.append(('%{libcxx_src_root}', self.libcxx_src_root))
> >>>>        # Configure flags substitutions
> >>>> -        flags_str = ' '.join([pipes.quote(f) for f in
> self.cxx.flags])
> >>>> -        compile_flags_str = ' '.join([pipes.quote(f) for f in
> >>>> self.cxx.compile_flags])
> >>>> -        link_flags_str = ' '.join([pipes.quote(f) for f in
> >>>> self.cxx.link_flags])
> >>>> -        all_flags = '%s %s %s' % (flags_str, compile_flags_str,
> >>>> link_flags_str)
> >>>> -        sub.append(('%{flags}', flags_str))
> >>>> -        sub.append(('%{compile_flags}', compile_flags_str))
> >>>> -        sub.append(('%{link_flags}', link_flags_str))
> >>>> +        sub.append(('%{flags}',         ' '.join(map(pipes.quote,
> >>>> self.cxx.flags))))
> >>>> +        sub.append(('%{compile_flags}', ' '.join(map(pipes.quote,
> >>>> self.cxx.compile_flags))))
> >>>> +        sub.append(('%{link_flags}',    ' '.join(map(pipes.quote,
> >>>> self.cxx.link_flags))))
> >>>>        if self.cxx.isVerifySupported():
> >>>> -            verify_str = ' ' + ' '.join(self.cxx.verify_flags) + ' '
> >>>> -            sub.append(('%{verify}', verify_str))
> >>>> -        # Add compile and link shortcuts
> >>>> -        compile_str = (cxx_path + ' -o %t.o %s -c ' + flags_str
> >>>> -                       + ' ' + compile_flags_str)
> >>>> -        build_str = cxx_path + ' -o %t.exe %s ' + all_flags
> >>>> +            sub.append(('%{verify}', '
> '.join(self.cxx.verify_flags)))
> >>>> +        # Add compile and build shortcuts
> >>>> +        sub.append(('%{compile}', '%{cxx} -o %t.o %s -c %{flags}
> >>>> %{compile_flags}'))
> >>>> +        sub.append(('%{build}',   '%{cxx} -o %t.exe %s %{flags}
> >>>> %{compile_flags} %{link_flags}'))
> >>>>        if self.cxx.use_modules:
> >>>> -            sub.append(('%{build_module}', build_str))
> >>>> +            sub.append(('%{build_module}', '%{build}'))
> >>>>        elif self.cxx.modules_flags is not None:
> >>>> -            modules_str = ' '.join(self.cxx.modules_flags) + ' '
> >>>> -            sub.append(('%{build_module}', build_str + ' ' +
> >>>> modules_str))
> >>>> -        sub.append(('%{compile}', compile_str))
> >>>> -        sub.append(('%{build}', build_str))
> >>>> +            sub.append(('%{build_module}', '%{{build}} {}'.format('
> >>>> '.join(self.cxx.modules_flags))))
> >>>> +
> >>>>        # Configure exec prefix substitutions.
> >>>>        # Configure run env substitution.
> >>>>        codesign_ident = self.get_lit_conf('llvm_codesign_identity',
> >>>> '')
> >>>> @@ -1077,13 +1068,11 @@ def configure_substitutions(self):
> >>>>                  '--dependencies %%file_dependencies --env %s -- ' %
> >>>> \
> >>>>            (pipes.quote(sys.executable), pipes.quote(run_py),
> >>>>             codesign_ident, env_vars)
> >>>> -        run_str = exec_str + '%t.exe'
> >>>>        sub.append(('%{exec}', exec_str))
> >>>> -        sub.append(('%{run}', run_str))
> >>>> +        sub.append(('%{run}', '%{exec} %t.exe'))
> >>>>        # Configure not program substitutions
> >>>>        not_py = os.path.join(self.libcxx_src_root, 'utils', 'not.py')
> >>>> -        not_str = '%s %s ' % (pipes.quote(sys.executable),
> >>>> pipes.quote(not_py))
> >>>> -        sub.append(('%{not} ', not_str))
> >>>> +        sub.append(('%{not}', '{}
> >>>> {}'.format(pipes.quote(sys.executable), pipes.quote(not_py))))
> >>>>        if self.get_lit_conf('libcxx_gdb'):
> >>>>            sub.append(('%{libcxx_gdb}',
> >>>> self.get_lit_conf('libcxx_gdb')))
> >>>>
> >>>>
> >>>> diff  --git a/libcxx/utils/libcxx/test/format.py
> >>>> b/libcxx/utils/libcxx/test/format.py
> >>>> index 2776af182f71..b5046aba1ca4 100644
> >>>> --- a/libcxx/utils/libcxx/test/format.py
> >>>> +++ b/libcxx/utils/libcxx/test/format.py
> >>>> @@ -124,7 +124,8 @@ def _execute(self, test, lit_config):
> >>>>        substitutions = lit.TestRunner.getDefaultSubstitutions(test,
> >>>> tmpDir,
> >>>>                                                               tmpBase)
> >>>>        substitutions.append(('%file_dependencies', '
> >>>> '.join(data_files)))
> >>>> -        script = lit.TestRunner.applySubstitutions(script,
> >>>> substitutions)
> >>>> +        script = lit.TestRunner.applySubstitutions(script,
> >>>> substitutions,
> >>>> +
> >>>> recursion_limit=lit_config.recursiveExpansionLimit)
> >>>>
> >>>>        test_cxx = copy.deepcopy(self.cxx)
> >>>>        if is_fail_test:
> >>>>
> >>>>
> >>>>
> >>>> _______________________________________________
> >>>> libcxx-commits mailing list
> >>>> libcxx-commits at lists.llvm.org
> >>>> https://lists.llvm.org/cgi-bin/mailman/listinfo/libcxx-commits
> >>>>
> >>
> >>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20200330/be4c4f7d/attachment-0001.html>


More information about the libcxx-commits mailing list