File: Makefile

package info (click to toggle)
rustc 1.70.0%2Bdfsg1-9
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 722,120 kB
  • sloc: xml: 147,962; javascript: 10,210; sh: 8,590; python: 8,220; ansic: 5,901; cpp: 4,635; makefile: 4,001; asm: 2,856
file content (32 lines) | stat: -rw-r--r-- 1,560 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# ignore-cross-compile
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'