mirror of
https://github.com/allankoechke/rust.git
synced 2026-11-30 17:26:12 +00:00
23 lines
737 B
Rust
23 lines
737 B
Rust
//@ compile-flags: -Zunstable-options -Zoffload=Device -Clto=fat -Csymbol-mangling-version=v0 --crate-name collision_kernels_a
|
|
//@ build-fail
|
|
//@ needs-offload
|
|
|
|
// An offload kernel whose mangled symbol collides with another item in the
|
|
// same crate must be rejected, just like any other symbol collision.
|
|
|
|
#![feature(core_intrinsics, rustc_attrs)]
|
|
#![allow(internal_features)]
|
|
|
|
#[allow(non_snake_case)]
|
|
#[no_mangle]
|
|
pub fn _RNvC19collision_kernels_a6kernel(_x: f32) {}
|
|
|
|
#[rustc_offload_kernel]
|
|
fn kernel(_x: f32) {}
|
|
//~^ ERROR symbol `_RNvC19collision_kernels_a6kernel` is already defined
|
|
|
|
fn main() {
|
|
_RNvC19collision_kernels_a6kernel(0.0);
|
|
core::intrinsics::offload::<_, _, ()>(kernel, [1, 1, 1], [1, 1, 1], 0, (0.0f32,));
|
|
}
|