Skip to content

Commit

Permalink
make naked function generics test stricter
Browse files Browse the repository at this point in the history
  • Loading branch information
folkertdev committed Dec 10, 2024
1 parent 69a0c64 commit 4202c1e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tests/codegen/naked-fn/generics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,13 @@ impl Invert for i64 {
}
}

// CHECK-LABEL: generic_function
// CHECK: .balign 4
// CHECK-LABEL: generic_function:
// CHECK: call
// CHECK: ret

#[naked]
#[no_mangle]
pub extern "C" fn generic_function<T: Invert>(x: i64) -> i64 {
unsafe {
naked_asm!(
Expand All @@ -75,8 +76,8 @@ pub extern "C" fn generic_function<T: Invert>(x: i64) -> i64 {
#[repr(transparent)]
struct Foo(u64);

// CHECK-LABEL: method
// CHECK: .balign 4
// CHECK-LABEL: method:
// CHECK: mov rax, rdi

impl Foo {
Expand All @@ -87,8 +88,8 @@ impl Foo {
}
}

// CHECK-LABEL: trait_method
// CHECK: .balign 4
// CHECK-LABEL: trait_method:
// CHECK: mov rax, rdi

trait Bar {
Expand All @@ -103,8 +104,8 @@ impl Bar for Foo {
}
}

// CHECK-LABEL: naked_with_args_and_return
// CHECK: .balign 4
// CHECK-LABEL: naked_with_args_and_return:
// CHECK: lea rax, [rdi + rsi]

// this previously ICE'd, see https://github.com/rust-lang/rust/issues/124375
Expand Down

0 comments on commit 4202c1e

Please sign in to comment.