mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-07 03:16:05 +03:00

This also fixes a pessimization where the `memcmp` call would become an `invoke` if the user provides his own `memcmp` prototype in the code (the prototype would not carry the `nounwind` function attribute).
11 lines
360 B
D
11 lines
360 B
D
// Tests that static array (in)equality of unequal lengths is optimized to `false`.
|
|
|
|
// RUN: %ldc -c -O3 -output-ll -of=%t.ll %s && FileCheck %s --check-prefix=LLVM < %t.ll
|
|
|
|
// LLVM-LABEL: define{{.*}} @{{.*}}different_lengths
|
|
// ASM-LABEL: different_lengths{{.*}}:
|
|
bool different_lengths(bool[4] a, bool[3] b)
|
|
{
|
|
// LLVM: ret i1 false
|
|
return a == b;
|
|
}
|