summaryrefslogtreecommitdiffstats
path: root/src/test/ui/stack-protector
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:02:58 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:02:58 +0000
commit698f8c2f01ea549d77d7dc3338a12e04c11057b9 (patch)
tree173a775858bd501c378080a10dca74132f05bc50 /src/test/ui/stack-protector
parentInitial commit. (diff)
downloadrustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.tar.xz
rustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.zip
Adding upstream version 1.64.0+dfsg1.upstream/1.64.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/ui/stack-protector')
-rw-r--r--src/test/ui/stack-protector/warn-stack-protector-unsupported.all.stderr4
-rw-r--r--src/test/ui/stack-protector/warn-stack-protector-unsupported.basic.stderr4
-rw-r--r--src/test/ui/stack-protector/warn-stack-protector-unsupported.rs19
-rw-r--r--src/test/ui/stack-protector/warn-stack-protector-unsupported.strong.stderr4
4 files changed, 31 insertions, 0 deletions
diff --git a/src/test/ui/stack-protector/warn-stack-protector-unsupported.all.stderr b/src/test/ui/stack-protector/warn-stack-protector-unsupported.all.stderr
new file mode 100644
index 000000000..548877155
--- /dev/null
+++ b/src/test/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/src/test/ui/stack-protector/warn-stack-protector-unsupported.basic.stderr b/src/test/ui/stack-protector/warn-stack-protector-unsupported.basic.stderr
new file mode 100644
index 000000000..f7a1ee39f
--- /dev/null
+++ b/src/test/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/src/test/ui/stack-protector/warn-stack-protector-unsupported.rs b/src/test/ui/stack-protector/warn-stack-protector-unsupported.rs
new file mode 100644
index 000000000..6df5d3cd5
--- /dev/null
+++ b/src/test/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/src/test/ui/stack-protector/warn-stack-protector-unsupported.strong.stderr b/src/test/ui/stack-protector/warn-stack-protector-unsupported.strong.stderr
new file mode 100644
index 000000000..ccc2f9f2c
--- /dev/null
+++ b/src/test/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
+