diff options
| author | Scott McMurray <scottmcm@users.noreply.github.com> | 2021-06-02 23:35:30 -0700 |
|---|---|---|
| committer | Scott McMurray <scottmcm@users.noreply.github.com> | 2021-07-08 14:55:59 -0700 |
| commit | 07fb5ee78f4f251637c5c4414982a8c6e32e186d (patch) | |
| tree | 29a0dcf21152e5b172a4026dcbcf3aa860e335ee /src/test/codegen/array-equality.rs | |
| parent | 6444f24a29d1b9868e5dba647daf8209499757f6 (diff) | |
| download | rust-07fb5ee78f4f251637c5c4414982a8c6e32e186d.tar.gz rust-07fb5ee78f4f251637c5c4414982a8c6e32e186d.zip | |
Adjust the threshold to look at the ABI, not just the size
Diffstat (limited to 'src/test/codegen/array-equality.rs')
| -rw-r--r-- | src/test/codegen/array-equality.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/test/codegen/array-equality.rs b/src/test/codegen/array-equality.rs index aa56e32e26c..4b60fa4b0bf 100644 --- a/src/test/codegen/array-equality.rs +++ b/src/test/codegen/array-equality.rs @@ -23,6 +23,18 @@ pub fn array_eq_ref(a: &[u16; 6], b: &[u16; 6]) -> bool { a == b } +// CHECK-LABEL: @array_eq_value_still_passed_by_pointer +#[no_mangle] +pub fn array_eq_value_still_passed_by_pointer(a: [u16; 9], b: [u16; 9]) -> bool { + // CHECK-NEXT: start: + // CHECK-NEXT: bitcast + // CHECK-NEXT: bitcast + // CHECK-NEXT: %[[CMP:.+]] = tail call i32 @{{bcmp|memcmp}}(i8* nonnull dereferenceable(18) %{{.+}}, i8* nonnull dereferenceable(18) %{{.+}}, i64 18) + // CHECK-NEXT: %[[EQ:.+]] = icmp eq i32 %[[CMP]], 0 + // CHECK-NEXT: ret i1 %[[EQ]] + a == b +} + // CHECK-LABEL: @array_eq_long #[no_mangle] pub fn array_eq_long(a: &[u16; 1234], b: &[u16; 1234]) -> bool { |
