Skip to content

Commit b14f1e2

Browse files
Test backward compatibility
1 parent 5d0e236 commit b14f1e2

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

llvm/test/tools/llvm-profdata/memprof-yaml.test

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@
77
; RUN: llvm-profdata show --memory %t/memprof-out.indexed > %t/memprof-out.yaml
88
; RUN: diff -b %t/memprof-in.yaml %t/memprof-out.yaml
99

10+
; Merge text profile as v3 binary profile. Test that the merged v3 profile
11+
; are identical to memprof-in-v3.ymal, and doesn't have callee guids or dap.
12+
; RUN: llvm-profdata merge --memprof-version=3 %t/memprof-in.yaml -o %t/memprof-out-v3.indexed
13+
; RUN: llvm-profdata show --memory %t/memprof-out-v3.indexed > %t/memprof-out-v3.yaml
14+
; RUN: diff -b %t/memprof-out-v3.yaml %t/memprof-in-v3.yaml
15+
1016
; memprof-in-no-dap.yaml has empty data access profiles.
1117
; RUN: llvm-profdata merge --memprof-version=4 %t/memprof-in-no-dap.yaml -o %t/memprof-out.indexed
1218
; RUN: llvm-profdata show --memory %t/memprof-out.indexed > %t/memprof-out-no-dap.yaml
@@ -59,6 +65,35 @@ DataAccessProfiles:
5965
- bar
6066
KnownColdStrHashes: [ 999, 1001 ]
6167
...
68+
;--- memprof-in-v3.yaml
69+
---
70+
HeapProfileRecords:
71+
- GUID: 0xdeadbeef12345678
72+
AllocSites:
73+
- Callstack:
74+
- { Function: 0x1111111111111111, LineOffset: 11, Column: 10, IsInlineFrame: true }
75+
- { Function: 0x2222222222222222, LineOffset: 22, Column: 20, IsInlineFrame: false }
76+
MemInfoBlock:
77+
AllocCount: 111
78+
TotalSize: 222
79+
TotalLifetime: 333
80+
TotalLifetimeAccessDensity: 444
81+
- Callstack:
82+
- { Function: 0x3333333333333333, LineOffset: 33, Column: 30, IsInlineFrame: false }
83+
- { Function: 0x4444444444444444, LineOffset: 44, Column: 40, IsInlineFrame: true }
84+
MemInfoBlock:
85+
AllocCount: 555
86+
TotalSize: 666
87+
TotalLifetime: 777
88+
TotalLifetimeAccessDensity: 888
89+
CallSites:
90+
- Frames:
91+
- { Function: 0x5555555555555555, LineOffset: 55, Column: 50, IsInlineFrame: true }
92+
- { Function: 0x6666666666666666, LineOffset: 66, Column: 60, IsInlineFrame: false }
93+
- Frames:
94+
- { Function: 0x7777777777777777, LineOffset: 77, Column: 70, IsInlineFrame: true }
95+
- { Function: 0x8888888888888888, LineOffset: 88, Column: 80, IsInlineFrame: false }
96+
...
6297
;--- memprof-in-no-dap.yaml
6398
---
6499
HeapProfileRecords:

0 commit comments

Comments
 (0)