From 11b1d483b2f0e65e049c491c34a0f8573553f4b4 Mon Sep 17 00:00:00 2001 From: varkor Date: Tue, 30 Apr 2019 21:52:54 +0100 Subject: [PATCH] Add a run-make test for command aliases --- .../run-make/override-aliased-flags/Makefile | 22 +++++++++++++++++++ .../run-make/override-aliased-flags/main.rs | 1 + 2 files changed, 23 insertions(+) create mode 100644 src/test/run-make/override-aliased-flags/Makefile create mode 100644 src/test/run-make/override-aliased-flags/main.rs diff --git a/src/test/run-make/override-aliased-flags/Makefile b/src/test/run-make/override-aliased-flags/Makefile new file mode 100644 index 00000000000..866060ad998 --- /dev/null +++ b/src/test/run-make/override-aliased-flags/Makefile @@ -0,0 +1,22 @@ +-include ../../run-make-fulldeps/tools.mk + +# FIXME: it would be good to check that it's actually the rightmost flags +# that are used when multiple flags are specified, but I can't think of a +# reliable way to check this. + +all: + # Test that `-O` and `-C opt-level` can be specified multiple times. + # The rightmost flag will be used over any previous flags. + $(RUSTC) -O -O main.rs + $(RUSTC) -O -C opt-level=0 main.rs + $(RUSTC) -C opt-level=0 -O main.rs + $(RUSTC) -C opt-level=0 -C opt-level=2 main.rs + $(RUSTC) -C opt-level=2 -C opt-level=0 main.rs + + # Test that `-g` and `-C debuginfo` can be specified multiple times. + # The rightmost flag will be used over any previous flags. + $(RUSTC) -g -g main.rs + $(RUSTC) -g -C debuginfo=0 main.rs + $(RUSTC) -C debuginfo=0 -g main.rs + $(RUSTC) -C debuginfo=0 -C debuginfo=2 main.rs + $(RUSTC) -C debuginfo=2 -C debuginfo=0 main.rs diff --git a/src/test/run-make/override-aliased-flags/main.rs b/src/test/run-make/override-aliased-flags/main.rs new file mode 100644 index 00000000000..f328e4d9d04 --- /dev/null +++ b/src/test/run-make/override-aliased-flags/main.rs @@ -0,0 +1 @@ +fn main() {}