summaryrefslogtreecommitdiffstats
path: root/tests/ui/invalid-compile-flags
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-19 09:25:56 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-19 09:25:56 +0000
commit018c4950b9406055dec02ef0fb52f132e2bb1e2c (patch)
treea835ebdf2088ef88fa681f8fad45f09922c1ae9a /tests/ui/invalid-compile-flags
parentAdding debian version 1.75.0+dfsg1-5. (diff)
downloadrustc-018c4950b9406055dec02ef0fb52f132e2bb1e2c.tar.xz
rustc-018c4950b9406055dec02ef0fb52f132e2bb1e2c.zip
Merging upstream version 1.76.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ui/invalid-compile-flags')
-rw-r--r--tests/ui/invalid-compile-flags/branch-protection-missing-pac-ret.BADTARGET.stderr2
-rw-r--r--tests/ui/invalid-compile-flags/fuel.rs11
-rw-r--r--tests/ui/invalid-compile-flags/function-return/requires-x86-or-x86_64.aarch64.stderr4
-rw-r--r--tests/ui/invalid-compile-flags/function-return/requires-x86-or-x86_64.rs20
-rw-r--r--tests/ui/invalid-compile-flags/function-return/thunk-extern-requires-non-large-code-model.large.stderr4
-rw-r--r--tests/ui/invalid-compile-flags/function-return/thunk-extern-requires-non-large-code-model.rs21
-rw-r--r--tests/ui/invalid-compile-flags/invalid-llvm-passes.stderr2
7 files changed, 62 insertions, 2 deletions
diff --git a/tests/ui/invalid-compile-flags/branch-protection-missing-pac-ret.BADTARGET.stderr b/tests/ui/invalid-compile-flags/branch-protection-missing-pac-ret.BADTARGET.stderr
index 52a591902..7bc17c5c6 100644
--- a/tests/ui/invalid-compile-flags/branch-protection-missing-pac-ret.BADTARGET.stderr
+++ b/tests/ui/invalid-compile-flags/branch-protection-missing-pac-ret.BADTARGET.stderr
@@ -1,4 +1,4 @@
error: `-Zbranch-protection` is only supported on aarch64
-error: aborting due to previous error
+error: aborting due to 1 previous error
diff --git a/tests/ui/invalid-compile-flags/fuel.rs b/tests/ui/invalid-compile-flags/fuel.rs
new file mode 100644
index 000000000..456bc47d3
--- /dev/null
+++ b/tests/ui/invalid-compile-flags/fuel.rs
@@ -0,0 +1,11 @@
+// revisions: incremental threads
+// dont-check-compiler-stderr
+//
+// [threads] compile-flags: -Zfuel=a=1 -Zthreads=2
+// [threads] error-pattern:optimization fuel is incompatible with multiple threads
+//
+// [incremental] incremental
+// [incremental] compile-flags: -Zprint-fuel=a
+// [incremental] error-pattern:optimization fuel is incompatible with incremental compilation
+
+fn main() {}
diff --git a/tests/ui/invalid-compile-flags/function-return/requires-x86-or-x86_64.aarch64.stderr b/tests/ui/invalid-compile-flags/function-return/requires-x86-or-x86_64.aarch64.stderr
new file mode 100644
index 000000000..a4fe77f5c
--- /dev/null
+++ b/tests/ui/invalid-compile-flags/function-return/requires-x86-or-x86_64.aarch64.stderr
@@ -0,0 +1,4 @@
+error: `-Zfunction-return` (except `keep`) is only supported on x86 and x86_64
+
+error: aborting due to 1 previous error
+
diff --git a/tests/ui/invalid-compile-flags/function-return/requires-x86-or-x86_64.rs b/tests/ui/invalid-compile-flags/function-return/requires-x86-or-x86_64.rs
new file mode 100644
index 000000000..15a88ebdb
--- /dev/null
+++ b/tests/ui/invalid-compile-flags/function-return/requires-x86-or-x86_64.rs
@@ -0,0 +1,20 @@
+// revisions: x86 x86_64 aarch64
+
+// compile-flags: -Zfunction-return=thunk-extern
+
+//[x86] check-pass
+//[x86] needs-llvm-components: x86
+//[x86] compile-flags: --target i686-unknown-linux-gnu
+
+//[x86_64] check-pass
+//[x86_64] needs-llvm-components: x86
+//[x86_64] compile-flags: --target x86_64-unknown-linux-gnu
+
+//[aarch64] check-fail
+//[aarch64] needs-llvm-components: aarch64
+//[aarch64] compile-flags: --target aarch64-unknown-linux-gnu
+//[aarch64] error-pattern: `-Zfunction-return` (except `keep`) is only supported on x86 and x86_64
+
+#![feature(no_core)]
+#![no_core]
+#![no_main]
diff --git a/tests/ui/invalid-compile-flags/function-return/thunk-extern-requires-non-large-code-model.large.stderr b/tests/ui/invalid-compile-flags/function-return/thunk-extern-requires-non-large-code-model.large.stderr
new file mode 100644
index 000000000..683b3213d
--- /dev/null
+++ b/tests/ui/invalid-compile-flags/function-return/thunk-extern-requires-non-large-code-model.large.stderr
@@ -0,0 +1,4 @@
+error: `-Zfunction-return=thunk-extern` is only supported on non-large code models
+
+error: aborting due to 1 previous error
+
diff --git a/tests/ui/invalid-compile-flags/function-return/thunk-extern-requires-non-large-code-model.rs b/tests/ui/invalid-compile-flags/function-return/thunk-extern-requires-non-large-code-model.rs
new file mode 100644
index 000000000..f925905de
--- /dev/null
+++ b/tests/ui/invalid-compile-flags/function-return/thunk-extern-requires-non-large-code-model.rs
@@ -0,0 +1,21 @@
+// revisions: small kernel medium large
+
+// needs-llvm-components: x86
+// compile-flags: --target x86_64-unknown-linux-gnu -Zfunction-return=thunk-extern
+
+//[small] check-pass
+//[small] compile-flags: -Ccode-model=small
+
+//[kernel] check-pass
+//[kernel] compile-flags: -Ccode-model=kernel
+
+//[medium] check-pass
+//[medium] compile-flags: -Ccode-model=medium
+
+//[large] check-fail
+//[large] compile-flags: -Ccode-model=large
+//[large] error-pattern: `-Zfunction-return=thunk-extern` is only supported on non-large code models
+
+#![feature(no_core)]
+#![no_core]
+#![no_main]
diff --git a/tests/ui/invalid-compile-flags/invalid-llvm-passes.stderr b/tests/ui/invalid-compile-flags/invalid-llvm-passes.stderr
index ae1f85e41..bbacf3f46 100644
--- a/tests/ui/invalid-compile-flags/invalid-llvm-passes.stderr
+++ b/tests/ui/invalid-compile-flags/invalid-llvm-passes.stderr
@@ -1,4 +1,4 @@
error: failed to run LLVM passes: unknown pass name 'unknown-pass'
-error: aborting due to previous error
+error: aborting due to 1 previous error