summaryrefslogtreecommitdiffstats
path: root/tests/ui/stack-protector
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:03 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:03 +0000
commit64d98f8ee037282c35007b64c2649055c56af1db (patch)
tree5492bcf97fce41ee1c0b1cc2add283f3e66cdab0 /tests/ui/stack-protector
parentAdding debian version 1.67.1+dfsg1-1. (diff)
downloadrustc-64d98f8ee037282c35007b64c2649055c56af1db.tar.xz
rustc-64d98f8ee037282c35007b64c2649055c56af1db.zip
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ui/stack-protector')
-rw-r--r--tests/ui/stack-protector/warn-stack-protector-unsupported.all.stderr4
-rw-r--r--tests/ui/stack-protector/warn-stack-protector-unsupported.basic.stderr4
-rw-r--r--tests/ui/stack-protector/warn-stack-protector-unsupported.rs19
-rw-r--r--tests/ui/stack-protector/warn-stack-protector-unsupported.strong.stderr4
4 files changed, 31 insertions, 0 deletions
diff --git a/tests/ui/stack-protector/warn-stack-protector-unsupported.all.stderr b/tests/ui/stack-protector/warn-stack-protector-unsupported.all.stderr
new file mode 100644
index 000000000..548877155
--- /dev/null
+++ b/tests/ui/stack-protector/warn-stack-protector-unsupported.all.stderr
@@ -0,0 +1,4 @@
+warning: `-Z stack-protector=all` is not supported for target nvptx64-nvidia-cuda and will be ignored
+
+warning: 1 warning emitted
+
diff --git a/tests/ui/stack-protector/warn-stack-protector-unsupported.basic.stderr b/tests/ui/stack-protector/warn-stack-protector-unsupported.basic.stderr
new file mode 100644
index 000000000..f7a1ee39f
--- /dev/null
+++ b/tests/ui/stack-protector/warn-stack-protector-unsupported.basic.stderr
@@ -0,0 +1,4 @@
+warning: `-Z stack-protector=basic` is not supported for target nvptx64-nvidia-cuda and will be ignored
+
+warning: 1 warning emitted
+
diff --git a/tests/ui/stack-protector/warn-stack-protector-unsupported.rs b/tests/ui/stack-protector/warn-stack-protector-unsupported.rs
new file mode 100644
index 000000000..6df5d3cd5
--- /dev/null
+++ b/tests/ui/stack-protector/warn-stack-protector-unsupported.rs
@@ -0,0 +1,19 @@
+// build-pass
+// revisions: all strong basic
+// compile-flags: --target nvptx64-nvidia-cuda
+// needs-llvm-components: nvptx
+// [all] compile-flags: -Z stack-protector=all
+// [strong] compile-flags: -Z stack-protector=strong
+// [basic] compile-flags: -Z stack-protector=basic
+
+#![crate_type = "lib"]
+#![feature(no_core, lang_items)]
+#![no_std]
+#![no_core]
+
+#[lang = "sized"]
+trait Sized {}
+#[lang = "copy"]
+trait Copy {}
+
+pub fn main(){}
diff --git a/tests/ui/stack-protector/warn-stack-protector-unsupported.strong.stderr b/tests/ui/stack-protector/warn-stack-protector-unsupported.strong.stderr
new file mode 100644
index 000000000..ccc2f9f2c
--- /dev/null
+++ b/tests/ui/stack-protector/warn-stack-protector-unsupported.strong.stderr
@@ -0,0 +1,4 @@
+warning: `-Z stack-protector=strong` is not supported for target nvptx64-nvidia-cuda and will be ignored
+
+warning: 1 warning emitted
+