NVPTX:_Especially add the DoubleI32 struct as a nvptx abi test case since it was used as an example when discussing possible problems

This commit is contained in:
Kjetil Kjeka 2024-05-31 23:12:33 +02:00
parent 14348d9519
commit a49fe0a58c
3 changed files with 31 additions and 0 deletions

View File

@ -40,6 +40,11 @@ pub struct TripleU16 {
h: u16,
}
#[repr(C)]
pub struct DoubleI32 {
f: i32,
g: i32,
}
#[repr(C)]
pub struct TripleU32 {
f: u32,
g: u32,
@ -175,6 +180,11 @@ pub struct ManyNumerics {
#[no_mangle]
pub unsafe extern "C" fn f_triple_u32_arg(_a: TripleU32) {}
// CHECK: .visible .func f_double_i32_arg(
// CHECK: .param .align 4 .b8 f_double_i32_arg_param_0[8]
#[no_mangle]
pub unsafe extern "C" fn f_double_i32_arg(_a: DoubleI32) {}
// CHECK: .visible .func f_triple_u64_arg(
// CHECK: .param .align 8 .b8 f_triple_u64_arg_param_0[24]
#[no_mangle]

View File

@ -40,6 +40,11 @@ pub struct TripleU16 {
h: u16,
}
#[repr(C)]
pub struct DoubleI32 {
f: i32,
g: i32,
}
#[repr(C)]
pub struct TripleU32 {
f: u32,
g: u32,
@ -186,6 +191,12 @@ pub struct ManyNumerics {
TripleU16 { f: 18, g: 19, h: 20 }
}
// CHECK: .visible .func (.param .align 4 .b8 func_retval0[8]) f_double_i32_ret(
#[no_mangle]
pub unsafe extern "C" fn f_double_i32_ret() -> DoubleI32 {
DoubleI32 { f: 1, g: 2 }
}
// CHECK: .visible .func (.param .align 4 .b8 func_retval0[12]) f_triple_u32_ret(
#[no_mangle]
pub unsafe extern "C" fn f_triple_u32_ret() -> TripleU32 {

View File

@ -50,6 +50,11 @@ pub struct TripleU16 {
h: u16,
}
#[repr(C)]
pub struct DoubleI32 {
f: i32,
g: i32,
}
#[repr(C)]
pub struct TripleU32 {
f: u32,
g: u32,
@ -180,6 +185,11 @@ pub struct ManyNumerics {
#[no_mangle]
pub unsafe extern "ptx-kernel" fn f_triple_u16_arg(_a: TripleU16) {}
// CHECK: .visible .entry f_double_i32_arg(
// CHECK: .param .align 4 .b8 f_double_i32_arg_param_0[8]
#[no_mangle]
pub unsafe extern "ptx-kernel" fn f_double_i32_arg(_a: DoubleI32) {}
// CHECK: .visible .entry f_triple_u32_arg(
// CHECK: .param .align 4 .b8 f_triple_u32_arg_param_0[12]
#[no_mangle]