72800d3b89
Except for `simd-intrinsic/`, which has a lot of files containing multiple types like `u8x64` which really are better when hand-formatted. There is a surprising amount of two-space indenting in this directory. Non-trivial changes: - `rustfmt::skip` needed in `debug-column.rs` to preserve meaning of the test. - `rustfmt::skip` used in a few places where hand-formatting read more nicely: `enum/enum-match.rs` - Line number adjustments needed for the expected output of `debug-column.rs` and `coroutine-debug.rs`.
40 lines
689 B
Rust
40 lines
689 B
Rust
// This test checks that comparison operation
|
|
// generated by #[derive(PartialOrd)]
|
|
// doesn't contain jumps for C enums
|
|
|
|
//@ compile-flags: -Copt-level=3
|
|
|
|
#![crate_type = "lib"]
|
|
|
|
#[repr(u32)]
|
|
#[derive(Copy, Clone, Eq, PartialEq, PartialOrd)]
|
|
pub enum Foo {
|
|
Zero,
|
|
One,
|
|
Two,
|
|
}
|
|
|
|
#[no_mangle]
|
|
pub fn compare_less(a: Foo, b: Foo) -> bool {
|
|
// CHECK-NOT: br {{.*}}
|
|
a < b
|
|
}
|
|
|
|
#[no_mangle]
|
|
pub fn compare_le(a: Foo, b: Foo) -> bool {
|
|
// CHECK-NOT: br {{.*}}
|
|
a <= b
|
|
}
|
|
|
|
#[no_mangle]
|
|
pub fn compare_ge(a: Foo, b: Foo) -> bool {
|
|
// CHECK-NOT: br {{.*}}
|
|
a >= b
|
|
}
|
|
|
|
#[no_mangle]
|
|
pub fn compare_greater(a: Foo, b: Foo) -> bool {
|
|
// CHECK-NOT: br {{.*}}
|
|
a > b
|
|
}
|