[llvm] 546c72a - [llvm-ranlib] Update expected error message check for Windows

Alex Richardson via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 2 10:00:42 PST 2020


Author: Alex Richardson
Date: 2020-01-02T18:00:04Z
New Revision: 546c72a78b34966a17d37218d3a676d9eccf17f2

URL: https://github.com/llvm/llvm-project/commit/546c72a78b34966a17d37218d3a676d9eccf17f2
DIFF: https://github.com/llvm/llvm-project/commit/546c72a78b34966a17d37218d3a676d9eccf17f2.diff

LOG: [llvm-ranlib] Update expected error message check for Windows

On Windows hosts, the error message will be something like
`c:\src\llvm-project\out\gn\bin\llvm-ranlib.exe: error: Invalid option: '--D'`.
Due to the .exe after llvm-ranlib the existing CHECK lines do not match.
Fix this by ignoring the program name and starting the check line at "error:".

Added: 
    

Modified: 
    llvm/test/tools/llvm-ranlib/D-flag.test

Removed: 
    


################################################################################
diff  --git a/llvm/test/tools/llvm-ranlib/D-flag.test b/llvm/test/tools/llvm-ranlib/D-flag.test
index 79c9d5ec735e..39f07d8f5c47 100644
--- a/llvm/test/tools/llvm-ranlib/D-flag.test
+++ b/llvm/test/tools/llvm-ranlib/D-flag.test
@@ -29,17 +29,17 @@
 ## Check that the -D/-U option is only accepted with a single dash. This matches
 ## the GNU ranlib behaviour.
 # RUN: not llvm-ranlib --D %t.a 2>&1 | FileCheck %s --check-prefix=BAD-OPT-D
-# BAD-OPT-D: llvm-ranlib: error: Invalid option: '--D'
+# BAD-OPT-D: error: Invalid option: '--D'
 # RUN: not llvm-ranlib --U %t.a 2>&1 | FileCheck %s --check-prefix=BAD-OPT-U
-# BAD-OPT-U: llvm-ranlib: error: Invalid option: '--U'
+# BAD-OPT-U: error: Invalid option: '--U'
 # RUN: not llvm-ranlib -x %t.a 2>&1 | FileCheck %s --check-prefix=BAD-OPT-x
-# BAD-OPT-x: llvm-ranlib: error: Invalid option: '-x'
+# BAD-OPT-x: error: Invalid option: '-x'
 
 ## If the first argument starts with value flags, the error message only shows
 ## the remainder of the parsed string:
 # RUN: not llvm-ranlib -Dx %t.a 2>&1 | FileCheck %s --check-prefix=BAD-OPT-x
 # RUN: not llvm-ranlib -DxD %t.a 2>&1 | FileCheck %s --check-prefix=BAD-OPT-xD
-# BAD-OPT-xD: llvm-ranlib: error: Invalid option: '-xD'
+# BAD-OPT-xD: error: Invalid option: '-xD'
 
 # DETERMINISTIC-VALUES: {{[rwx-]+}} 0/0    712 Jan  1 00:00 1970 D-flag.test.tmp.o
 # REAL-VALUES: {{[rwx-]+}} {{[0-9]+}}/{{[0-9]+}} 712 Jan  2 03:04 2000 D-flag.test.tmp.o


        


More information about the llvm-commits mailing list