Skip to content

Commit 11145b7

Browse files
ellishggithub-actions[bot]
authored andcommitted
Automerge: [InstrProf][NFC] Refactor profdata trace tests (#152550)
Refactor some llvm-profdata tests to read text profiles which are easier to match with FileCheck
2 parents a12f91b + 3b32893 commit 11145b7

File tree

2 files changed

+33
-33
lines changed

2 files changed

+33
-33
lines changed

llvm/test/tools/llvm-profdata/merge-traces.proftext

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,27 @@
1-
# RUN: llvm-profdata merge --temporal-profile-trace-reservoir-size=2 %s -o %t.profdata
2-
# RUN: llvm-profdata show --temporal-profile-traces %t.profdata | FileCheck %s --check-prefixes=SAMPLE1,SEEN1
3-
# RUN: llvm-profdata merge --temporal-profile-trace-reservoir-size=2 %s %t.profdata -o %t.profdata
4-
# RUN: llvm-profdata show --temporal-profile-traces %t.profdata | FileCheck %s --check-prefixes=SAMPLE2,SEEN2
5-
# RUN: llvm-profdata merge --temporal-profile-trace-reservoir-size=2 %s %t.profdata -o %t.profdata
6-
# RUN: llvm-profdata show --temporal-profile-traces %t.profdata | FileCheck %s --check-prefixes=SAMPLE2,SEEN3
7-
# RUN: llvm-profdata merge --temporal-profile-trace-reservoir-size=2 %s %t.profdata -o %t.profdata
8-
# RUN: llvm-profdata show --temporal-profile-traces %t.profdata | FileCheck %s --check-prefixes=SAMPLE2,SEEN4
9-
10-
# SEEN1: Temporal Profile Traces (samples=1 seen=1):
11-
# SEEN2: Temporal Profile Traces (samples=2 seen=2):
12-
# SEEN3: Temporal Profile Traces (samples=2 seen=3):
13-
# SEEN4: Temporal Profile Traces (samples=2 seen=4):
14-
# SAMPLE1: Temporal Profile Trace 0 (weight=1 count=3):
15-
# SAMPLE1: a
16-
# SAMPLE1: b
17-
# SAMPLE1: c
18-
# SAMPLE2: Temporal Profile Trace 1 (weight=1 count=3):
19-
# SAMPLE2: a
20-
# SAMPLE2: b
21-
# SAMPLE2: c
1+
# RUN: llvm-profdata merge --temporal-profile-trace-reservoir-size=2 %s --text | FileCheck %s --check-prefixes=CHECK,SEEN1,SAMPLE1
2+
3+
# Merge %s twice so it has two traces
4+
# RUN: llvm-profdata merge --temporal-profile-trace-reservoir-size=2 %s %s --text | FileCheck %s --check-prefixes=CHECK,SEEN2,SAMPLE2
5+
# RUN: llvm-profdata merge --temporal-profile-trace-reservoir-size=2 %s %s -o %t-2.profdata
6+
7+
# RUN: llvm-profdata merge --temporal-profile-trace-reservoir-size=2 %s %s %s --text | FileCheck %s --check-prefixes=CHECK,SEEN3,SAMPLE2
8+
# RUN: llvm-profdata merge --temporal-profile-trace-reservoir-size=2 %t-2.profdata %s --text | FileCheck %s --check-prefixes=CHECK,SEEN3,SAMPLE2
9+
# RUN: llvm-profdata merge --temporal-profile-trace-reservoir-size=2 %s %t-2.profdata --text | FileCheck %s --check-prefixes=CHECK,SEEN3,SAMPLE2
10+
11+
# RUN: llvm-profdata merge --temporal-profile-trace-reservoir-size=2 %s %s %s %s --text | FileCheck %s --check-prefixes=CHECK,SEEN4,SAMPLE2
12+
# RUN: llvm-profdata merge --temporal-profile-trace-reservoir-size=2 %t-2.profdata %s %s --text | FileCheck %s --check-prefixes=CHECK,SEEN4,SAMPLE2
13+
# RUN: llvm-profdata merge --temporal-profile-trace-reservoir-size=2 %t-2.profdata %t-2.profdata --text | FileCheck %s --check-prefixes=CHECK,SEEN4,SAMPLE2
14+
15+
# CHECK: :temporal_prof_traces
16+
# CHECK: # Num Temporal Profile Traces:
17+
# SAMPLE1: 1
18+
# SAMPLE2: 2
19+
# CHECK: # Temporal Profile Trace Stream Size:
20+
# SEEN1: 1
21+
# SEEN2: 2
22+
# SEEN3: 3
23+
# SEEN4: 4
24+
# CHECK: a,b,c,
2225

2326
# Header
2427
:ir

llvm/test/tools/llvm-profdata/read-traces.proftext

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,16 @@
33
# RUN: llvm-profdata merge -text %t.2.profdata -o %t.3.proftext
44
# RUN: diff %t.1.proftext %t.3.proftext
55

6-
# RUN: llvm-profdata show --temporal-profile-traces %t.1.proftext | FileCheck %s
6+
# RUN: llvm-profdata merge -text %s | FileCheck %s
77

8-
# CHECK: Temporal Profile Traces (samples=3 seen=3):
9-
# CHECK: Temporal Profile Trace 0 (weight=1 count=3):
10-
# CHECK: foo
11-
# CHECK: bar
12-
# CHECK: goo
13-
# CHECK: Temporal Profile Trace 1 (weight=3 count=3):
14-
# CHECK: foo
15-
# CHECK: goo
16-
# CHECK: bar
17-
# CHECK: Temporal Profile Trace 2 (weight=1 count=1):
18-
# CHECK: goo
8+
# CHECK: :temporal_prof_traces
9+
# CHECK: # Num Temporal Profile Traces:
10+
# CHECK-NEXT: 3
11+
# CHECK: # Temporal Profile Trace Stream Size:
12+
# CHECK-NEXT: 3
13+
# CHECK-DAG: foo,bar,goo,
14+
# CHECK-DAG: foo,goo,bar,
15+
# CHECK-DAG: goo,
1916

2017
# Header
2118
:ir

0 commit comments

Comments
 (0)