[llvm] [llvm-objcopy] Check for missing argument values (PR #70710)

via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 31 07:53:49 PDT 2023


================
@@ -0,0 +1,4 @@
+## An error must be reported if a required argument value is missing.
+# RUN: not llvm-objcopy --only-section 2>&1 | FileCheck --check-prefix=CHECK-NO-VALUE %s
+# RUN: not llvm-objcopy -O 2>&1 | FileCheck --check-prefix=CHECK-NO-VALUE %s
+# CHECK-NO-VALUE: error: argument to '{{.*}}' is missing
----------------
quic-akaryaki wrote:

I am using a wildcard to reuse one pattern for several (two) different options. The point of this test is to verify that the message gets printed. I think there is enough context in the message to avoid misidentification for other messages.
I am not checking if the message is exactly the same because I don't see it as a realistic possibility. 
I don't think a random corruption in the output is likely, and testing for it would be outside of the scope of this test.

https://github.com/llvm/llvm-project/pull/70710


More information about the llvm-commits mailing list