]>
git.proxmox.com Git - rustc.git/blob - src/test/codegen/issue-75659.rs
1 // This test checks that the call to memchr/slice_contains is optimized away
2 // when searching in small slices.
4 // compile-flags: -O -Zinline-mir=no
11 pub fn foo1(x
: u8, data
: &[u8; 1]) -> bool
{
13 // CHECK-NOT: slice_contains
19 pub fn foo2(x
: u8, data
: &[u8; 2]) -> bool
{
21 // CHECK-NOT: slice_contains
27 pub fn foo3(x
: u8, data
: &[u8; 3]) -> bool
{
29 // CHECK-NOT: slice_contains
35 pub fn foo4(x
: u8, data
: &[u8; 4]) -> bool
{
37 // CHECK-NOT: slice_contains
43 pub fn foo8(x
: u8, data
: &[u8; 8]) -> bool
{
45 // CHECK-NOT: slice_contains
49 // CHECK-LABEL: @foo8_i8
51 pub fn foo8_i8(x
: i8, data
: &[i8; 8]) -> bool
{
53 // CHECK-NOT: slice_contains
57 // Check that the general case isn't inlined
58 // CHECK-LABEL: @foo80
60 pub fn foo80(x
: u8, data
: &[u8; 80]) -> bool
{
61 // CHECK: call core::slice::memchr