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 e7d6da3Copy full SHA for e7d6da3
tests/codegen/array-cmp.rs
@@ -0,0 +1,18 @@
1
+// Ensure the asm for array comparisons is properly optimized.
2
+
3
+//@ compile-flags: -C opt-level=2
4
5
+#![crate_type = "lib"]
6
7
+// CHECK-LABEL: @compare
8
+// CHECK: start:
9
+// CHECK-NEXT: ret i1 true
10
+#[no_mangle]
11
+pub fn compare() -> bool {
12
+ let bytes = 12.5f32.to_ne_bytes();
13
+ bytes == if cfg!(target_endian = "big") {
14
+ [0x41, 0x48, 0x00, 0x00]
15
+ } else {
16
+ [0x00, 0x00, 0x48, 0x41]
17
+ }
18
+}
0 commit comments