about summary refs log tree commit diff
path: root/tests/ui/codegen
diff options
context:
space:
mode:
authorMatthias Krüger <476013+matthiaskrgr@users.noreply.github.com>2025-07-11 07:35:19 +0200
committerGitHub <noreply@github.com>2025-07-11 07:35:19 +0200
commit66799d0b83df8ef34df210ba454b59fce53fd1e9 (patch)
tree4d5703b8d224e0d654c41b81edd9eb7fed76be7d /tests/ui/codegen
parent3d6eb225e26448b09fdec1ba7222f3e7174c6ac2 (diff)
parent259512e3b6a920b1e1eb6034fbc738e7b9815337 (diff)
downloadrust-66799d0b83df8ef34df210ba454b59fce53fd1e9.tar.gz
rust-66799d0b83df8ef34df210ba454b59fce53fd1e9.zip
Rollup merge of #143303 - Kivooeo:tf28, r=tgross35
`tests/ui`: A New Order [28/28] FINAL PART

> [!NOTE]
>
> Intermediate commits are intended to help review, but will be squashed prior to merge.

Some `tests/ui/` housekeeping, to trim down number of tests directly under `tests/ui/`. Part of rust-lang/rust#133895.

r? ``@tgross35``
Diffstat (limited to 'tests/ui/codegen')
-rw-r--r--tests/ui/codegen/llvm-args-invalid-flag.rs22
-rw-r--r--tests/ui/codegen/llvm-args-invalid-flag.stderr1
2 files changed, 23 insertions, 0 deletions
diff --git a/tests/ui/codegen/llvm-args-invalid-flag.rs b/tests/ui/codegen/llvm-args-invalid-flag.rs
new file mode 100644
index 00000000000..a8fa55a220a
--- /dev/null
+++ b/tests/ui/codegen/llvm-args-invalid-flag.rs
@@ -0,0 +1,22 @@
+//@ compile-flags: -Cllvm-args=-not-a-real-llvm-arg
+//@ normalize-stderr: "--help" -> "-help"
+//@ normalize-stderr: "\n(\n|.)*" -> ""
+
+// I'm seeing "--help" locally, but "-help" in CI, so I'm normalizing it to just "-help".
+
+// Note that the rustc-supplied "program name", given when invoking LLVM, is used by LLVM to
+// generate user-facing error messages and a usage (--help) messages. If the program name is
+// `rustc`, the usage message in response to `--llvm-args="--help"` starts with:
+// ```
+//   USAGE: rustc [options]
+// ```
+// followed by the list of options not to `rustc` but to `llvm`.
+//
+// On the other hand, if the program name is set to `rustc -Cllvm-args="..." with`, the usage
+// message is more clear:
+// ```
+//   USAGE: rustc -Cllvm-args="..." with [options]
+// ```
+// This test captures the effect of the current program name setting on LLVM command line
+// error messages.
+fn main() {}
diff --git a/tests/ui/codegen/llvm-args-invalid-flag.stderr b/tests/ui/codegen/llvm-args-invalid-flag.stderr
new file mode 100644
index 00000000000..e1d3cfea28f
--- /dev/null
+++ b/tests/ui/codegen/llvm-args-invalid-flag.stderr
@@ -0,0 +1 @@
+rustc -Cllvm-args="..." with: Unknown command line argument '-not-a-real-llvm-arg'.  Try: 'rustc -Cllvm-args="..." with -help'
\ No newline at end of file