Skip to content

Commit 4b6c191

Browse files
authored
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
2 parents ce18639 + 7032c92 commit 4b6c191

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

tests/assembly/manual-eq-efficient.rs

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// Regression test for #106269
2+
//@ assembly-output: emit-asm
3+
//@ compile-flags: --crate-type=lib -O -C llvm-args=-x86-asm-syntax=intel
4+
//@ only-x86_64
5+
//@ ignore-sgx
6+
7+
pub struct S {
8+
a: u8,
9+
b: u8,
10+
c: u8,
11+
d: u8,
12+
}
13+
14+
// CHECK-LABEL: manual_eq:
15+
#[no_mangle]
16+
pub fn manual_eq(s1: &S, s2: &S) -> bool {
17+
// CHECK: mov [[REG:[a-z0-9]+]], dword ptr [{{[a-z0-9]+}}]
18+
// CHECK-NEXT: cmp [[REG]], dword ptr [{{[a-z0-9]+}}]
19+
// CHECK-NEXT: sete al
20+
// CHECK: ret
21+
s1.a == s2.a && s1.b == s2.b && s1.c == s2.c && s1.d == s2.d
22+
}

0 commit comments

Comments
 (0)