Skip to content

Commit 19648ce

Browse files
committed
codegen test for non-memcmp array comparison
1 parent 3c0f722 commit 19648ce

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/codegen/array-cmp.rs

+12
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,15 @@ pub fn compare() -> bool {
1717
[0x00, 0x00, 0x48, 0x41]
1818
}
1919
}
20+
21+
// CHECK-LABEL: @array_of_tuple_le
22+
// CHECK: call{{.+}}i8 @llvm.scmp.i8.i16
23+
// CHECK: call{{.+}}i8 @llvm.ucmp.i8.i16
24+
// CHECK: call{{.+}}i8 @llvm.scmp.i8.i16
25+
// CHECK: call{{.+}}i8 @llvm.ucmp.i8.i16
26+
// CHECK: %[[RET:.+]] = icmp slt i8 {{.+}}, 1
27+
// CHECK: ret i8 %[[RET]]
28+
#[no_mangle]
29+
pub fn array_of_tuple_le(a: &[(i16, u16); 2], b: &[(i16, u16); 2]) -> bool {
30+
a <= b
31+
}

0 commit comments

Comments
 (0)