fork/rust
git clone https://git.julia.blue/fork/rust
4fb7144ed15
1.43.0
1 2# First, establish that certain !prof labels are attached to the expected 3# functions and branching instructions. 4 5CHECK: define void @function_called_twice(i32 %c) {{.*}} !prof [[function_called_twice_id:![0-9]+]] { 6CHECK: br i1 {{.*}}, label {{.*}}, label {{.*}}, !prof [[branch_weights0:![0-9]+]] 7 8CHECK: define void @function_called_42_times(i32 %c) {{.*}} !prof [[function_called_42_times_id:![0-9]+]] { 9CHECK: switch i32 %c, label {{.*}} [ 10CHECK-NEXT: i32 97, label {{.*}} 11CHECK-NEXT: i32 98, label {{.*}} 12CHECK-NEXT: ], !prof [[branch_weights1:![0-9]+]] 13 14CHECK: define void @function_called_never(i32 {{.*}} !prof [[function_called_never_id:![0-9]+]] { 15 16 17 18# Now check that those !prof tags hold the expected counts 19 20CHECK: [[function_called_twice_id]] = !{!"function_entry_count", i64 2} 21CHECK: [[branch_weights0]] = !{!"branch_weights", i32 2, i32 0} 22CHECK: [[function_called_42_times_id]] = !{!"function_entry_count", i64 42} 23CHECK: [[branch_weights1]] = !{!"branch_weights", i32 2, i32 12, i32 28} 24CHECK: [[function_called_never_id]] = !{!"function_entry_count", i64 0}