[PATCH] D82549: [AIX][XCOFF] parsing xcoff object file auxiliary header

James Henderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 8 00:37:02 PST 2021


jhenderson added a comment.

In D82549#3111784 <https://reviews.llvm.org/D82549#3111784>, @DiggerLin wrote:

>> As far as I can tell, there is no reason why the test should not work on Windows, apart from some bug in this code - rGc2d2fb509306618b982bff94e1ad9acff6a41bcf <https://reviews.llvm.org/rGc2d2fb509306618b982bff94e1ad9acff6a41bcf> appears to only be a temporary fix to get the build bot green again)
>
> I think the fail in the window is related to  
> llvm-readobj --auxiliary-header %p/Inputs/xcoff-64-xlc-exec **2>&1**
>
> C:\src\llvm-project\llvm\test\tools\llvm-readobj\XCOFF\xcoff-auxiliary-header.test:91:11: error: WARN64: expected string not found in input
> \# WARN64: {{.*}}llvm-readobj: warning: '<stdin>': There are extra data beyond auxiliary header
>
> the window can not deal with  **2>&1** correctly as  linux (or aix) .
> so I add a guardian  
> \# REQUIRES: system-aix 
> is OK.  do you have any good solution ?  @jhenderson

`2>&1` works fine in all other tests that use it (it is commonly used for testing errors), so it won't ever be that. I ran this test locally, and it was clear what the problem was: your warning check starts with `{{.*}}llvm-readobj:` but on Windows, the executable name is `llvm-readobj.exe`, so the ".exe" doesn't match and the test fails. Adding `(.exe)?` would fix this, although I believe we usually don't bother checking the tool name as part of the warning/error message (take a look at other test cases to see what we typically check for llvm-readobj errors).



================
Comment at: llvm/test/tools/llvm-readobj/XCOFF/xcoff-auxiliary-header.test:1
+## This file tests the ability of llvm-readobj to display the auxiliary header for 64 bits XCOFF and 32 bits XCOFF object file.
+# RUN: llvm-readobj --auxiliary-header %p/Inputs/xcoff-64-xlc-exec 2>&1 | \
----------------
You can remove `xcoff` from the test name, as it's in the XCOFF folder. The xcoff bit of the name is superfluous.

Same goes for the input files - no need for a leading `xcoff`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D82549



More information about the llvm-commits mailing list