Skip to content
/ rustc Public
forked from rust-lang/rust

Commit

Permalink
add assembly test for rust-lang#83585
Browse files Browse the repository at this point in the history
  • Loading branch information
tesuji committed May 20, 2024
1 parent 882f64c commit 5cccf3f
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions tests/assembly/issue-83585-small-pod-struct-equality.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
//@ assembly-output: emit-asm
//@ compile-flags:-Copt-level=3
//@ only-x86_64

#![crate_type = "lib"]

#[no_mangle]
type T = u8;
type T1 = (T, T, T, T, T, T, T, T);
type T2 = [T; 8];

#[no_mangle]
// CHECK-LABEL: foo1a
// CHECK: cmp
// CHECK-NEXT: set
// CHECK-NEXT: ret
pub fn foo1a(a: T1, b: T1) -> bool {
a == b
}

#[no_mangle]
// CHECK-LABEL: foo1b
// CHECK: mov
// CHECK-NEXT: cmp
// CHECK-NEXT: set
// CHECK-NEXT: ret
pub fn foo1b(a: &T1, b: &T1) -> bool {
a == b
}

0 comments on commit 5cccf3f

Please sign in to comment.