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.
2 parents 885b456 + 422de35 commit 65dff32Copy full SHA for 65dff32
tests/codegen/array-cmp.rs
@@ -0,0 +1,17 @@
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-NEXT: ret i1 true
9
+#[no_mangle]
10
+pub fn compare() -> bool {
11
+ let bytes = 12.5f32.to_ne_bytes();
12
+ bytes == if cfg!(target_endian = "big") {
13
+ [0x41, 0x48, 0x00, 0x00]
14
+ } else {
15
+ [0x00, 0x00, 0x48, 0x41]
16
+ }
17
+}
0 commit comments