[PATCH] D123998: llvm-reduce: Try to parse triple/datalayout from module

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 27 17:15:55 PDT 2022


arsenm added a comment.

In D123998#3478719 <https://reviews.llvm.org/D123998#3478719>, @haowei wrote:

> Test `LLVM :: tools/llvm-reduce/fail-file-open.test` is still failing on our windows bots after the fix:
>
>   Script:
>   --
>   : 'RUN: at line 1';   not llvm-reduce --test=echo C:\b\s\w\ir\x\w\llvm-llvm-project\llvm\test\tools\llvm-reduce\fail-file-open.test.NotAFileInTestingDir 2>&1 | c:\b\s\w\ir\x\w\staging\llvm_build\bin\filecheck.exe C:\b\s\w\ir\x\w\llvm-llvm-project\llvm\test\tools\llvm-reduce\fail-file-open.test
>   --
>   Exit Code: 1
>   
>   Command Output (stdout):
>   --
>   $ ":" "RUN: at line 1"
>   $ "not" "llvm-reduce" "--test=echo" "C:\b\s\w\ir\x\w\llvm-llvm-project\llvm\test\tools\llvm-reduce\fail-file-open.test.NotAFileInTestingDir"
>   $ "c:\b\s\w\ir\x\w\staging\llvm_build\bin\filecheck.exe" "C:\b\s\w\ir\x\w\llvm-llvm-project\llvm\test\tools\llvm-reduce\fail-file-open.test"
>   # command stderr:
>   C:\b\s\w\ir\x\w\llvm-llvm-project\llvm\test\tools\llvm-reduce\fail-file-open.test:5:10: error: CHECK: expected string not found in input
>   # CHECK: llvm-reduce: {{.*}}.NotAFileInTestingDir: error:
>            ^
>   <stdin>:1:1: note: scanning from here
>   llvm-reduce.exe: C:\b\s\w\ir\x\w\llvm-llvm-project\llvm\test\tools\llvm-reduce\fail-file-open.test.NotAFileInTestingDir: error: Could not open input file: no such file or directory
>   ^
>   <stdin>:1:81: note: possible intended match here
>   llvm-reduce.exe: C:\b\s\w\ir\x\w\llvm-llvm-project\llvm\test\tools\llvm-reduce\fail-file-open.test.NotAFileInTestingDir: error: Could not open input file: no such file or directory
>                                                                                   ^
>   
>   Input file: <stdin>
>   Check file: C:\b\s\w\ir\x\w\llvm-llvm-project\llvm\test\tools\llvm-reduce\fail-file-open.test
>   
>   -dump-input=help explains the following input dump.
>   
>   Input was:
>   <<<<<<
>              1: llvm-reduce.exe: C:\b\s\w\ir\x\w\llvm-llvm-project\llvm\test\tools\llvm-reduce\fail-file-open.test.NotAFileInTestingDir: error: Could not open input file: no such file or directory 
>   check:5'0     X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
>   check:5'1                                                                                     ?                                                                                                     possible intended match
>   >>>>>>
>   
>   error: command failed with exit status: 1
>   
>   --
>
> This test still did not consider the ".exe" suffix on Windows
>
> LLVM :: tools/llvm-reduce/mir/infer-triple-unknown-target.mir did passed on our builder but I think the capital "N" issue depends on the toolchain and SDK you use on Windows. Test like lld/test/COFF/driver.test use something like `# RUN: FileCheck -DMSG=%errc_ENOENT -check-prefix=MISSING %s < %t.log` to avoid this issue. And there is a dedicate CMake step in https://github.com/llvm/llvm-project/blob/c265170110b2e3b82ab8fca6658bfbbce79381c5/llvm/cmake/modules/GetErrcMessages.cmake#L31 to generate correct error string under different OS.
>
> You probably want to use this approach in your tests.

I’m not sure I understand this approach. Maybe it’s just not worth testing the error message prefix


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D123998/new/

https://reviews.llvm.org/D123998



More information about the llvm-commits mailing list