diff --git a/tests/codegen-llvm/gpu_offload/gpu_host.rs b/tests/codegen-llvm/gpu_offload/gpu_host.rs index 5d01df1dc7191..51053505e71bb 100644 --- a/tests/codegen-llvm/gpu_offload/gpu_host.rs +++ b/tests/codegen-llvm/gpu_offload/gpu_host.rs @@ -42,8 +42,6 @@ pub fn _kernel_1(x: &mut [f32; 256], y: &[f32; 256]) { // CHECK: @anon.[[ID:.*]].0 = private unnamed_addr constant [23 x i8] c";unknown;unknown;0;0;;\00", align 1 // CHECK: @anon.{{.*}}.1 = private unnamed_addr constant %struct.ident_t { i32 0, i32 2, i32 0, i32 22, ptr @anon.[[ID]].0 }, align 8 -// CHECK-DAG: @.omp_offloading.descriptor = internal constant { i32, ptr, ptr, ptr } zeroinitializer -// CHECK-DAG: @llvm.global_ctors = appending constant [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 101, ptr @.omp_offloading.descriptor_reg, ptr null }] // CHECK-DAG: @.offload_sizes.[[K:[^ ]*kernel_1]] = private unnamed_addr constant [2 x i64] [i64 1024, i64 1024] // CHECK-DAG: @.offload_maptypes.[[K]].begin = private unnamed_addr constant [2 x i64] [i64 1, i64 1] // CHECK-DAG: @.offload_maptypes.[[K]].kernel = private unnamed_addr constant [2 x i64] [i64 32, i64 32] @@ -98,21 +96,4 @@ pub fn _kernel_1(x: &mut [f32; 256], y: &[f32; 256]) { // CHECK: ret void // CHECK-NEXT: } -// CHECK: declare void @__tgt_register_lib(ptr) local_unnamed_addr -// CHECK: declare void @__tgt_unregister_lib(ptr) local_unnamed_addr - -// CHECK-LABEL: define internal void @.omp_offloading.descriptor_reg() section ".text.startup" -// CHECK-NEXT: entry: -// CHECK-NEXT: {{tail }}call void @__tgt_register_lib(ptr nonnull @.omp_offloading.descriptor) -// CHECK-NEXT: {{tail }}call void @__tgt_init_all_rtls() -// CHECK-NEXT: %0 = {{tail }}call i32 @atexit(ptr nonnull @.omp_offloading.descriptor_unreg) -// CHECK-NEXT: ret void -// CHECK-NEXT: } - -// CHECK-LABEL: define internal void @.omp_offloading.descriptor_unreg() section ".text.startup" -// CHECK-NEXT: entry: -// CHECK-NEXT: {{tail }}call void @__tgt_unregister_lib(ptr nonnull @.omp_offloading.descriptor) -// CHECK-NEXT: ret void -// CHECK-NEXT: } - // CHECK: !{i32 7, !"openmp", i32 51} diff --git a/tests/codegen-llvm/gpu_offload/slice_device.rs b/tests/codegen-llvm/gpu_offload/slice_device.rs index 6e900c21ca7cb..34d9156befa74 100644 --- a/tests/codegen-llvm/gpu_offload/slice_device.rs +++ b/tests/codegen-llvm/gpu_offload/slice_device.rs @@ -17,7 +17,7 @@ extern crate minicore; // amdgpu-NEXT: define amdgpu_kernel void @foo // CHECK-SAME: ptr nofree readnone captures(none) %dyn_ptr // nvptx-SAME: [2 x i64] %0 -// amdgpu-SAME: ptr noalias {{.*}} %0, i64 {{.*}} %1 +// amdgpu-SAME: ptr addrspace(4) {{.*}} byref([16 x i8]) align 8 {{.*}} %0) // CHECK-NEXT: entry: // CHECK-NEXT: ret void // CHECK-NEXT: } diff --git a/tests/run-make/offload/host-std-device-nostd/rmake.rs b/tests/run-make/offload/host-std-device-nostd/rmake.rs index 6769993f9cf98..9b527bd94811d 100644 --- a/tests/run-make/offload/host-std-device-nostd/rmake.rs +++ b/tests/run-make/offload/host-std-device-nostd/rmake.rs @@ -25,12 +25,12 @@ fn main() { .emit("obj") .run(); - rfs::write(cwd().join("device.bin"), [0u8; 8]); + rfs::write(cwd().join("device.elf"), [0u8; 8]); rustc() .input("example.rs") .arg("-Zunstable-options") - .arg(format!("-Zoffload=Host={}", cwd().join("device.bin").display())) + .arg(format!("-Zoffload=Host={}", cwd().join("device.elf").display())) .arg("-Csymbol-mangling-version=v0") .arg("-Clto=fat") .emit("obj") diff --git a/tests/ui/offload/non_tuple_args.stderr b/tests/ui/offload/non_tuple_args.stderr index d930db4646490..5dfbbfbdfe788 100644 --- a/tests/ui/offload/non_tuple_args.stderr +++ b/tests/ui/offload/non_tuple_args.stderr @@ -1,5 +1,5 @@ error: `args` must be a tuple literal - --> $DIR/non_tuple_args.rs:7:5 + --> $DIR/non_tuple_args.rs:8:5 | LL | core::offload::offload! { kernel = kernel_0, args = 42 } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -7,7 +7,7 @@ LL | core::offload::offload! { kernel = kernel_0, args = 42 } = note: this error originates in the macro `$crate::offload` which comes from the expansion of the macro `core::offload::offload` (in Nightly builds, run with -Z macro-backtrace for more info) error: `args` must be a tuple literal - --> $DIR/non_tuple_args.rs:13:5 + --> $DIR/non_tuple_args.rs:14:5 | LL | core::offload::offload! { kernel = kernel_0, args = args } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/offload/region_by_ref.stderr b/tests/ui/offload/region_by_ref.stderr index b3aed2909a480..494fd385d04d0 100644 --- a/tests/ui/offload/region_by_ref.stderr +++ b/tests/ui/offload/region_by_ref.stderr @@ -1,23 +1,23 @@ error: offload kernel argument 0 contains a `Region` nested inside another type. Pass the `Region` by value so it can be mapped like a slice - --> $DIR/region_by_ref.rs:30:5 + --> $DIR/region_by_ref.rs:32:5 | LL | core::intrinsics::offload::<_, _, ()>( | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: offload kernel argument 0 contains a `Region` nested inside another type. Pass the `Region` by value so it can be mapped like a slice - --> $DIR/region_by_ref.rs:42:5 + --> $DIR/region_by_ref.rs:44:5 | LL | core::intrinsics::offload::<_, _, ()>( | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: offload kernel argument 0 contains a `Region` nested inside another type. Pass the `Region` by value so it can be mapped like a slice - --> $DIR/region_by_ref.rs:54:5 + --> $DIR/region_by_ref.rs:56:5 | LL | core::intrinsics::offload::<_, _, ()>( | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: offload kernel argument 0 contains a `Region` nested inside another type. Pass the `Region` by value so it can be mapped like a slice - --> $DIR/region_by_ref.rs:66:5 + --> $DIR/region_by_ref.rs:68:5 | LL | core::intrinsics::offload::<_, _, ()>( | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/tests/ui/offload/type_mismatch.stderr b/tests/ui/offload/type_mismatch.stderr index 808768e7cd4f3..a0c8e26bea0a2 100644 --- a/tests/ui/offload/type_mismatch.stderr +++ b/tests/ui/offload/type_mismatch.stderr @@ -1,35 +1,35 @@ error: expected a function item for the offload kernel, found `i32` - --> $DIR/type_mismatch.rs:8:5 + --> $DIR/type_mismatch.rs:9:5 | LL | core::intrinsics::offload::<_, _, ()>(not_fn, [1, 1, 1], [1, 1, 1], 0, -1, ()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: offload kernel expects 1 arguments, but 0 arguments were provided - --> $DIR/type_mismatch.rs:12:5 + --> $DIR/type_mismatch.rs:13:5 | LL | core::intrinsics::offload::<_, _, ()>(kernel_1, [1, 1, 1], [1, 1, 1], 0, -1, ()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: type mismatch in offload kernel argument 0: expected `f32`, found `f64` - --> $DIR/type_mismatch.rs:16:5 + --> $DIR/type_mismatch.rs:17:5 | LL | core::intrinsics::offload::<_, _, ()>(kernel_1, [1, 1, 1], [1, 1, 1], 0, -1, (42.0f64,)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: offload kernel return type mismatch: kernel returns `()`, but offload call expects `f64` - --> $DIR/type_mismatch.rs:20:18 + --> $DIR/type_mismatch.rs:21:18 | LL | let _: f64 = core::intrinsics::offload::<_, _, f64>(kernel_0, [1, 1, 1], [1, 1, 1], 0, -1, ()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: type mismatch in offload kernel argument 0: expected `f32`, found `f64` - --> $DIR/type_mismatch.rs:24:5 + --> $DIR/type_mismatch.rs:25:5 | LL | core::intrinsics::offload::<_, _, ()>( | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: type mismatch in offload kernel argument 1: expected `f32`, found `f64` - --> $DIR/type_mismatch.rs:24:5 + --> $DIR/type_mismatch.rs:25:5 | LL | core::intrinsics::offload::<_, _, ()>( | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^