[lld] bd6e018 - [ELF][test] Improve -v and --version tests
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 20 17:05:43 PDT 2022
Author: Fangrui Song
Date: 2022-09-20T17:05:36-07:00
New Revision: bd6e018472452a72ca36408ae43caf349b1c1b27
URL: https://github.com/llvm/llvm-project/commit/bd6e018472452a72ca36408ae43caf349b1c1b27
DIFF: https://github.com/llvm/llvm-project/commit/bd6e018472452a72ca36408ae43caf349b1c1b27.diff
LOG: [ELF][test] Improve -v and --version tests
Added:
lld/test/ELF/version.test
Modified:
lld/test/ELF/driver.test
Removed:
################################################################################
diff --git a/lld/test/ELF/driver.test b/lld/test/ELF/driver.test
index e346b11cd405f..cb43998bf9120 100644
--- a/lld/test/ELF/driver.test
+++ b/lld/test/ELF/driver.test
@@ -17,11 +17,6 @@
# HELP: USAGE:
# HELP: : supported targets:{{.*}} elf
-# RUN: ld.lld --version 2>&1 | FileCheck -check-prefix=VERSION %s
-# RUN: ld.lld -v 2>&1 | FileCheck -check-prefix=VERSION %s
-# RUN: not ld.lld -v xyz 2>&1 | FileCheck -check-prefix=VERSION %s
-# VERSION: LLD {{.*}} (compatible with GNU linkers)
-
# RUN: not ld.lld --versin 2>&1 | FileCheck -check-prefix=SPELLVERSION %s
# SPELLVERSION: unknown argument '--versin', did you mean '--version'
diff --git a/lld/test/ELF/version.test b/lld/test/ELF/version.test
new file mode 100644
index 0000000000000..ab753963690fa
--- /dev/null
+++ b/lld/test/ELF/version.test
@@ -0,0 +1,9 @@
+## --version skips input file processing.
+# RUN: ld.lld --version %t/not-exist 2>&1 | FileCheck %s
+
+## -v/-V don't skip processing if there is any input.
+# RUN: ld.lld -v 2>&1 | FileCheck %s
+# RUN: not ld.lld -v %t/not-exist 2>&1 | FileCheck %s
+# RUN: ld.lld -V 2>&1 | FileCheck %s
+
+# CHECK: LLD {{.*}} (compatible with GNU linkers)
More information about the llvm-commits
mailing list