summaryrefslogtreecommitdiffstats
path: root/tests/run-make-fulldeps/codegen-options-parsing
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:03 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:03 +0000
commit64d98f8ee037282c35007b64c2649055c56af1db (patch)
tree5492bcf97fce41ee1c0b1cc2add283f3e66cdab0 /tests/run-make-fulldeps/codegen-options-parsing
parentAdding debian version 1.67.1+dfsg1-1. (diff)
downloadrustc-64d98f8ee037282c35007b64c2649055c56af1db.tar.xz
rustc-64d98f8ee037282c35007b64c2649055c56af1db.zip
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/run-make-fulldeps/codegen-options-parsing')
-rw-r--r--tests/run-make-fulldeps/codegen-options-parsing/Makefile31
-rw-r--r--tests/run-make-fulldeps/codegen-options-parsing/dummy.rs1
2 files changed, 32 insertions, 0 deletions
diff --git a/tests/run-make-fulldeps/codegen-options-parsing/Makefile b/tests/run-make-fulldeps/codegen-options-parsing/Makefile
new file mode 100644
index 000000000..b063593c9
--- /dev/null
+++ b/tests/run-make-fulldeps/codegen-options-parsing/Makefile
@@ -0,0 +1,31 @@
+include ../tools.mk
+
+all:
+ #Option taking a number
+ $(RUSTC) -C codegen-units dummy.rs 2>&1 | \
+ $(CGREP) 'codegen option `codegen-units` requires a number'
+ $(RUSTC) -C codegen-units= dummy.rs 2>&1 | \
+ $(CGREP) 'incorrect value `` for codegen option `codegen-units` - a number was expected'
+ $(RUSTC) -C codegen-units=foo dummy.rs 2>&1 | \
+ $(CGREP) 'incorrect value `foo` for codegen option `codegen-units` - a number was expected'
+ $(RUSTC) -C codegen-units=1 dummy.rs
+ #Option taking a string
+ $(RUSTC) -C extra-filename dummy.rs 2>&1 | \
+ $(CGREP) 'codegen option `extra-filename` requires a string'
+ $(RUSTC) -C extra-filename= dummy.rs 2>&1
+ $(RUSTC) -C extra-filename=foo dummy.rs 2>&1
+ #Option taking no argument
+ $(RUSTC) -C lto= dummy.rs 2>&1 | \
+ $(CGREP) 'codegen option `lto` - either a boolean (`yes`, `no`, `on`, `off`, etc), `thin`, `fat`, or omitted'
+ $(RUSTC) -C lto=1 dummy.rs 2>&1 | \
+ $(CGREP) 'codegen option `lto` - either a boolean (`yes`, `no`, `on`, `off`, etc), `thin`, `fat`, or omitted'
+ $(RUSTC) -C lto=foo dummy.rs 2>&1 | \
+ $(CGREP) 'codegen option `lto` - either a boolean (`yes`, `no`, `on`, `off`, etc), `thin`, `fat`, or omitted'
+ $(RUSTC) -C lto dummy.rs
+
+ # Should not link dead code...
+ $(RUSTC) --print link-args dummy.rs 2>&1 | \
+ $(CGREP) -e '--gc-sections|-z[^ ]* [^ ]*<ignore>|-dead_strip|/OPT:REF'
+ # ... unless you specifically ask to keep it
+ $(RUSTC) --print link-args -C link-dead-code dummy.rs 2>&1 | \
+ $(CGREP) -ve '--gc-sections|-z[^ ]* [^ ]*<ignore>|-dead_strip|/OPT:REF'
diff --git a/tests/run-make-fulldeps/codegen-options-parsing/dummy.rs b/tests/run-make-fulldeps/codegen-options-parsing/dummy.rs
new file mode 100644
index 000000000..f328e4d9d
--- /dev/null
+++ b/tests/run-make-fulldeps/codegen-options-parsing/dummy.rs
@@ -0,0 +1 @@
+fn main() {}