2025-06-01 13:38:02 -07:00
|
|
|
//@ revisions: HOST AMDGPU NVPTX
|
2025-02-24 09:26:54 +00:00
|
|
|
//@ add-core-stubs
|
2025-01-02 22:42:10 +01:00
|
|
|
//@ compile-flags: --crate-type=rlib
|
2025-06-01 13:38:02 -07:00
|
|
|
//@[AMDGPU] compile-flags: --target amdgcn-amd-amdhsa -Ctarget-cpu=gfx1100
|
|
|
|
|
//@[AMDGPU] needs-llvm-components: amdgpu
|
|
|
|
|
//@[NVPTX] compile-flags: --target nvptx64-nvidia-cuda
|
|
|
|
|
//@[NVPTX] needs-llvm-components: nvptx
|
2025-01-02 22:42:10 +01:00
|
|
|
|
|
|
|
|
#![feature(no_core, lang_items)]
|
|
|
|
|
#![no_core]
|
|
|
|
|
|
2025-02-24 09:26:54 +00:00
|
|
|
extern crate minicore;
|
|
|
|
|
use minicore::*;
|
2025-01-02 22:42:10 +01:00
|
|
|
|
|
|
|
|
// Functions
|
2025-02-05 11:15:27 -08:00
|
|
|
extern "gpu-kernel" fn f1(_: ()) {} //~ ERROR "gpu-kernel" ABI is experimental and subject to change
|
2025-06-01 13:38:02 -07:00
|
|
|
//[HOST]~^ ERROR is not a supported ABI
|
2025-01-02 22:42:10 +01:00
|
|
|
|
|
|
|
|
// Methods in trait definition
|
|
|
|
|
trait Tr {
|
2025-02-05 11:15:27 -08:00
|
|
|
extern "gpu-kernel" fn m1(_: ()); //~ ERROR "gpu-kernel" ABI is experimental and subject to change
|
2025-06-01 13:38:02 -07:00
|
|
|
//[HOST]~^ ERROR is not a supported ABI
|
2025-01-02 22:42:10 +01:00
|
|
|
|
2025-02-05 11:15:27 -08:00
|
|
|
extern "gpu-kernel" fn dm1(_: ()) {} //~ ERROR "gpu-kernel" ABI is experimental and subject to change
|
2025-06-01 13:38:02 -07:00
|
|
|
//[HOST]~^ ERROR is not a supported ABI
|
2025-01-02 22:42:10 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct S;
|
|
|
|
|
|
|
|
|
|
// Methods in trait impl
|
|
|
|
|
impl Tr for S {
|
2025-02-05 11:15:27 -08:00
|
|
|
extern "gpu-kernel" fn m1(_: ()) {} //~ ERROR "gpu-kernel" ABI is experimental and subject to change
|
2025-06-01 13:38:02 -07:00
|
|
|
//[HOST]~^ ERROR is not a supported ABI
|
2025-01-02 22:42:10 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Methods in inherent impl
|
|
|
|
|
impl S {
|
2025-02-05 11:15:27 -08:00
|
|
|
extern "gpu-kernel" fn im1(_: ()) {} //~ ERROR "gpu-kernel" ABI is experimental and subject to change
|
2025-06-01 13:38:02 -07:00
|
|
|
//[HOST]~^ ERROR is not a supported ABI
|
2025-01-02 22:42:10 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Function pointer types
|
2025-02-05 11:15:27 -08:00
|
|
|
type A1 = extern "gpu-kernel" fn(_: ()); //~ ERROR "gpu-kernel" ABI is experimental and subject to change
|
2025-06-01 13:38:02 -07:00
|
|
|
//[HOST]~^ ERROR is not a supported ABI
|
2025-01-02 22:42:10 +01:00
|
|
|
|
|
|
|
|
// Foreign modules
|
2025-02-05 11:15:27 -08:00
|
|
|
extern "gpu-kernel" {} //~ ERROR "gpu-kernel" ABI is experimental and subject to change
|
2025-06-01 13:38:02 -07:00
|
|
|
//[HOST]~^ ERROR is not a supported ABI
|