From d634cc5a559ced14f1a9f6bcf4b418e55e1036d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Rakic?= Date: Thu, 21 Sep 2023 13:29:04 +0000 Subject: [PATCH] add test for `-Clink-self-contained` consistency --- .../link-self-contained-consistency.many.stderr | 2 ++ .../link-self-contained-consistency.one.stderr | 2 ++ .../ui/linkage-attr/link-self-contained-consistency.rs | 10 ++++++++++ 3 files changed, 14 insertions(+) create mode 100644 tests/ui/linkage-attr/link-self-contained-consistency.many.stderr create mode 100644 tests/ui/linkage-attr/link-self-contained-consistency.one.stderr create mode 100644 tests/ui/linkage-attr/link-self-contained-consistency.rs diff --git a/tests/ui/linkage-attr/link-self-contained-consistency.many.stderr b/tests/ui/linkage-attr/link-self-contained-consistency.many.stderr new file mode 100644 index 0000000000000..a5fc96b4e0b2b --- /dev/null +++ b/tests/ui/linkage-attr/link-self-contained-consistency.many.stderr @@ -0,0 +1,2 @@ +error: some `-C link-self-contained` components were both enabled and disabled: crto, linker + diff --git a/tests/ui/linkage-attr/link-self-contained-consistency.one.stderr b/tests/ui/linkage-attr/link-self-contained-consistency.one.stderr new file mode 100644 index 0000000000000..5982b7a618e7e --- /dev/null +++ b/tests/ui/linkage-attr/link-self-contained-consistency.one.stderr @@ -0,0 +1,2 @@ +error: some `-C link-self-contained` components were both enabled and disabled: linker + diff --git a/tests/ui/linkage-attr/link-self-contained-consistency.rs b/tests/ui/linkage-attr/link-self-contained-consistency.rs new file mode 100644 index 0000000000000..9be72f559a9c4 --- /dev/null +++ b/tests/ui/linkage-attr/link-self-contained-consistency.rs @@ -0,0 +1,10 @@ +// Checks that self-contained linking components cannot be both enabled and disabled at the same +// time on the CLI. + +// check-fail +// revisions: one many +// [one] compile-flags: -Clink-self-contained=-linker -Clink-self-contained=+linker -Zunstable-options +// [many] compile-flags: -Clink-self-contained=+linker,+crto -Clink-self-contained=-linker,-crto -Zunstable-options +// ignore-tidy-linelength + +fn main() {}