about summary refs log tree commit diff
path: root/tests/ui/amdgpu-require-explicit-cpu.rs
diff options
context:
space:
mode:
authorFlakebi <flakebi@t-online.de>2025-01-02 15:19:43 +0100
committerFlakebi <flakebi@t-online.de>2025-01-31 09:59:41 +0100
commit56795fb77a69bc61836537175564455067adada6 (patch)
tree767ce44731d24bcfa861f3c351ca3c0c4342746f /tests/ui/amdgpu-require-explicit-cpu.rs
parenta730edcd67c7cb29d4458e170d4eb290387c27c3 (diff)
downloadrust-56795fb77a69bc61836537175564455067adada6.tar.gz
rust-56795fb77a69bc61836537175564455067adada6.zip
Add amdgpu target
Add target and compile the amdgpu llvm backend.
Diffstat (limited to 'tests/ui/amdgpu-require-explicit-cpu.rs')
-rw-r--r--tests/ui/amdgpu-require-explicit-cpu.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/ui/amdgpu-require-explicit-cpu.rs b/tests/ui/amdgpu-require-explicit-cpu.rs
new file mode 100644
index 00000000000..46778a1094f
--- /dev/null
+++ b/tests/ui/amdgpu-require-explicit-cpu.rs
@@ -0,0 +1,17 @@
+//@ revisions: nocpu cpu
+//@ no-prefer-dynamic
+//@ compile-flags: --crate-type=cdylib --target=amdgcn-amd-amdhsa
+//@ needs-llvm-components: amdgpu
+//@ needs-rust-lld
+//@[nocpu] error-pattern: target requires explicitly specifying a cpu
+//@[nocpu] build-fail
+//@[cpu] compile-flags: -Ctarget-cpu=gfx900
+//@[cpu] build-pass
+
+#![feature(no_core, lang_items)]
+#![no_core]
+
+#[lang="sized"]
+trait Sized {}
+
+pub fn foo() {}