1 // This test checks that jumps generated by logical operators can be optimized away
3 // compile-flags: -Copt-level=3
9 pub fuel_tank_size: u32,
11 pub wheel_diameter: u32,
16 // && chains should not prevent SIMD optimizations for primitives
17 impl PartialEq for Blueprint{
18 fn eq(&self, other: &Self)->bool{
19 // CHECK-NOT: call{{.*}}bcmp
20 // CHECK-NOT: call{{.*}}memcmp
21 // CHECK-NOT: br {{.*}}
22 self.fuel_tank_size == other.fuel_tank_size
23 && self.payload == other.payload
24 && self.wheel_diameter == other.wheel_diameter
25 && self.wheel_width == other.wheel_width
26 && self.storage == other.storage
31 pub struct Blueprint2 {
32 pub fuel_tank_size: u32,
34 pub wheel_diameter: u32,
39 // Derived PartialEq should not generate jumps and should use SIMD
41 pub fn partial_eq_should_not_jump(a: &Blueprint2, b:&Blueprint2)->bool{
42 // CHECK-NOT: call{{.*}}bcmp
43 // CHECK-NOT: call{{.*}}memcmp
44 // CHECK-NOT: br {{.*}}