about summary refs log tree commit diff
path: root/tests/codegen-llvm/intrinsics/likely_assert.rs
blob: 87ffb4ee3fb65038891fc91bdbf67a412f92e800 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//@ compile-flags: -Copt-level=3
#![crate_type = "lib"]

#[no_mangle]
pub fn test_assert(x: bool) {
    assert!(x);
}

// check that assert! emits branch weights

// CHECK-LABEL: @test_assert(
// CHECK: br i1 %x, label %bb2, label %bb1, !prof ![[NUM:[0-9]+]]
// CHECK: bb1:
// CHECK: panic
// CHECK: bb2:
// CHECK: ret void
// CHECK: ![[NUM]] = !{!"branch_weights", {{(!"expected", )?}}i32 2000, i32 1}