4 #Option taking a number
5 $(RUSTC) -C codegen-units dummy.rs 2>&1 | \
6 $(CGREP) 'codegen option `codegen-units` requires a number'
7 $(RUSTC) -C codegen-units= dummy.rs 2>&1 | \
8 $(CGREP) 'incorrect value `` for codegen option `codegen-units` - a number was expected'
9 $(RUSTC) -C codegen-units=foo dummy.rs 2>&1 | \
10 $(CGREP) 'incorrect value `foo` for codegen option `codegen-units` - a number was expected'
11 $(RUSTC) -C codegen-units=1 dummy.rs
12 #Option taking a string
13 $(RUSTC) -C extra-filename dummy.rs 2>&1 | \
14 $(CGREP) 'codegen option `extra-filename` requires a string'
15 $(RUSTC) -C extra-filename= dummy.rs 2>&1
16 $(RUSTC) -C extra-filename=foo dummy.rs 2>&1
17 #Option taking no argument
18 $(RUSTC) -C lto= dummy.rs 2>&1 | \
19 $(CGREP) 'codegen option `lto` - either a boolean (`yes`, `no`, `on`, `off`, etc), `thin`, `fat`, or omitted'
20 $(RUSTC) -C lto=1 dummy.rs 2>&1 | \
21 $(CGREP) 'codegen option `lto` - either a boolean (`yes`, `no`, `on`, `off`, etc), `thin`, `fat`, or omitted'
22 $(RUSTC) -C lto=foo dummy.rs 2>&1 | \
23 $(CGREP) 'codegen option `lto` - either a boolean (`yes`, `no`, `on`, `off`, etc), `thin`, `fat`, or omitted'
24 $(RUSTC) -C lto dummy.rs
26 # Should not link dead code...
27 $(RUSTC) -Z print-link-args dummy.rs 2>&1 | \
28 $(CGREP) -e '--gc-sections|-z[^ ]* [^ ]*<ignore>|-dead_strip|/OPT:REF'
29 # ... unless you specifically ask to keep it
30 $(RUSTC) -Z print-link-args -C link-dead-code dummy.rs 2>&1 | \
31 $(CGREP) -ve '--gc-sections|-z[^ ]* [^ ]*<ignore>|-dead_strip|/OPT:REF'