File: filecheck-patterns.txt

package info (click to toggle)
rustc 1.70.0%2Bdfsg1-9
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 722,120 kB
  • sloc: xml: 147,962; javascript: 10,210; sh: 8,590; python: 8,220; ansic: 5,901; cpp: 4,635; makefile: 4,001; asm: 2,856
file content (24 lines) | stat: -rw-r--r-- 1,096 bytes parent folder | download | duplicates (21)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24

# First, establish that certain !prof labels are attached to the expected
# functions and branching instructions.

CHECK: define void @function_called_twice(i32 {{.*}} !prof [[function_called_twice_id:![0-9]+]] {
CHECK: br i1 {{.*}}, label {{.*}}, label {{.*}}, !prof [[branch_weights0:![0-9]+]]

CHECK: define void @function_called_42_times(i32{{.*}} %c) {{.*}} !prof [[function_called_42_times_id:![0-9]+]] {
CHECK:      switch i32 %c, label {{.*}} [
CHECK-NEXT:     i32 97, label {{.*}}
CHECK-NEXT:     i32 98, label {{.*}}
CHECK-NEXT: ], !prof [[branch_weights1:![0-9]+]]

CHECK: define void @function_called_never(i32 {{.*}} !prof [[function_called_never_id:![0-9]+]] {



# Now check that those !prof tags hold the expected counts

CHECK: [[function_called_twice_id]] = !{!"function_entry_count", i64 2}
CHECK: [[branch_weights0]] = !{!"branch_weights", i32 2, i32 0}
CHECK: [[function_called_42_times_id]] = !{!"function_entry_count", i64 42}
CHECK: [[branch_weights1]] = !{!"branch_weights", i32 2, i32 12, i32 28}
CHECK: [[function_called_never_id]] = !{!"function_entry_count", i64 0}