mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 06:51:58 +00:00
Add another codegen test, array_eq_zero
Showing that this avoids an alloca and private constant.
This commit is contained in:
parent
12163534a9
commit
039a3bafec
@ -34,3 +34,12 @@ pub fn array_eq_long(a: &[u16; 1234], b: &[u16; 1234]) -> bool {
|
|||||||
// CHECK-NEXT: ret i1 %[[EQ]]
|
// CHECK-NEXT: ret i1 %[[EQ]]
|
||||||
a == b
|
a == b
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// CHECK-LABEL: @array_eq_zero(i128 %0)
|
||||||
|
#[no_mangle]
|
||||||
|
pub fn array_eq_zero(x: [u16; 8]) -> bool {
|
||||||
|
// CHECK-NEXT: start:
|
||||||
|
// CHECK-NEXT: %[[EQ:.+]] = icmp eq i128 %0, 0
|
||||||
|
// CHECK-NEXT: ret i1 %[[EQ]]
|
||||||
|
x == [0; 8]
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user