1 // This is a test for optimal Ord trait implementation for bool.
2 // See <https://github.com/rust-lang/rust/issues/66780> for more info.
4 // compile-flags: -C opt-level=3
8 use std::cmp::Ordering;
10 // CHECK-LABEL: @cmp_bool
12 pub fn cmp_bool(a: bool, b: bool) -> Ordering {
13 // LLVM 10 produces (zext a) + (sext b), but the final lowering is (zext a) - (zext b).
15 // CHECK: {{z|s}}ext i1
16 // CHECK: {{sub|add}} nsw