Skip to content

Commit

Permalink
Unrolled build for rust-lang#124299
Browse files Browse the repository at this point in the history
Rollup merge of rust-lang#124299 - clubby789:106269-test, r=nikic

Add test for issue 106269

Closes rust-lang#106269

Made this an assembly test as the LLVM codegen is still quite verbose and doesn't really indicate the behaviour we want
  • Loading branch information
rust-timer committed Apr 30, 2024
2 parents 20aa2d8 + 7032c92 commit e61b0bd
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/assembly/manual-eq-efficient.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Regression test for #106269
//@ assembly-output: emit-asm
//@ compile-flags: --crate-type=lib -O -C llvm-args=-x86-asm-syntax=intel
//@ only-x86_64
//@ ignore-sgx

pub struct S {
a: u8,
b: u8,
c: u8,
d: u8,
}

// CHECK-LABEL: manual_eq:
#[no_mangle]
pub fn manual_eq(s1: &S, s2: &S) -> bool {
// CHECK: mov [[REG:[a-z0-9]+]], dword ptr [{{[a-z0-9]+}}]
// CHECK-NEXT: cmp [[REG]], dword ptr [{{[a-z0-9]+}}]
// CHECK-NEXT: sete al
// CHECK: ret
s1.a == s2.a && s1.b == s2.b && s1.c == s2.c && s1.d == s2.d
}

0 comments on commit e61b0bd

Please sign in to comment.