summaryrefslogtreecommitdiffstats
path: root/tests/run-make/override-aliased-flags/Makefile
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:20:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:20:29 +0000
commit631cd5845e8de329d0e227aaa707d7ea228b8f8f (patch)
treea1b87c8f8cad01cf18f7c5f57a08f102771ed303 /tests/run-make/override-aliased-flags/Makefile
parentAdding debian version 1.69.0+dfsg1-1. (diff)
downloadrustc-631cd5845e8de329d0e227aaa707d7ea228b8f8f.tar.xz
rustc-631cd5845e8de329d0e227aaa707d7ea228b8f8f.zip
Merging upstream version 1.70.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/run-make/override-aliased-flags/Makefile')
-rw-r--r--tests/run-make/override-aliased-flags/Makefile23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/run-make/override-aliased-flags/Makefile b/tests/run-make/override-aliased-flags/Makefile
new file mode 100644
index 000000000..db1ff1ff9
--- /dev/null
+++ b/tests/run-make/override-aliased-flags/Makefile
@@ -0,0 +1,23 @@
+# ignore-cross-compile
+include ../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