diff --git a/tests/assembly/issue-83585-small-pod-struct-equality.rs b/tests/assembly/issue-83585-small-pod-struct-equality.rs new file mode 100644 index 0000000000000..56d458d851436 --- /dev/null +++ b/tests/assembly/issue-83585-small-pod-struct-equality.rs @@ -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 +} +