summary refs log tree commit diff
path: root/tests/run-make/codegen-options-parsing/Makefile
diff options
context:
space:
mode:
authorJoshua Nelson <github@jyn.dev>2023-03-30 07:34:55 -0500
committerJoshua Nelson <github@jyn.dev>2023-03-30 07:34:55 -0500
commit433da1fc047bb39a263eefca4bdb2b1972f1d2ce (patch)
tree28540e78fdd5fdf158267e67495121ac64f0866a /tests/run-make/codegen-options-parsing/Makefile
parentf2d9a3d0771504f1ae776226a5799dcb4408a91a (diff)
downloadrust-433da1fc047bb39a263eefca4bdb2b1972f1d2ce.tar.gz
rust-433da1fc047bb39a263eefca4bdb2b1972f1d2ce.zip
Move almost all run-make-fulldeps to run-make
They pass fine.
Diffstat (limited to 'tests/run-make/codegen-options-parsing/Makefile')
-rw-r--r--tests/run-make/codegen-options-parsing/Makefile31
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/run-make/codegen-options-parsing/Makefile b/tests/run-make/codegen-options-parsing/Makefile
new file mode 100644
index 00000000000..b063593c9d9
--- /dev/null
+++ b/tests/run-make/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'