We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6982935 commit 887246fCopy full SHA for 887246f
tests/assembly/62531-array-cmp.rs
@@ -0,0 +1,21 @@
1
+// Ensure the asm for array comparisons is properly optimized on x86.
2
+
3
+// min-llvm-version: 11
4
+// assembly-output: emit-asm
5
+// compile-flags: -C opt-level=2
6
+// only-x86_64
7
8
+#![crate_type = "lib"]
9
10
+// CHECK-LABEL: compare
11
+// CHECK: movb $1, %al
12
+// CHECK-NEXT: retq
13
+#[no_mangle]
14
+pub fn compare() -> bool {
15
+ let bytes = 12.5f32.to_ne_bytes();
16
+ bytes == if cfg!(target_endian = "big") {
17
+ [0x41, 0x48, 0x00, 0x00]
18
+ } else {
19
+ [0x00, 0x00, 0x48, 0x41]
20
+ }
21
+}
0 commit comments