summaryrefslogtreecommitdiffstats
path: root/llvm/test/tools/llvm-profdata/misaligned-binary-ids-size.test
blob: ee54bfb9785678bca991f2362f644e8fb97149b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
RUN: printf '\201rforpl\377' > %t.profraw
RUN: printf '\12\0\0\0\0\0\0\0' >> %t.profraw
// We should fail on this because the binary IDs is not a multiple of 8 bytes.
RUN: printf '\77\0\0\0\0\0\0\0' >> %t.profraw
RUN: printf '\0\0\0\0\0\0\0\0' >> %t.profraw
RUN: printf '\0\0\0\0\0\0\0\0' >> %t.profraw
RUN: printf '\0\0\0\0\0\0\0\0' >> %t.profraw
RUN: printf '\0\0\0\0\0\0\0\0' >> %t.profraw
RUN: printf '\0\0\0\0\0\0\0\0' >> %t.profraw
RUN: printf '\0\0\0\0\0\0\0\0' >> %t.profraw
RUN: printf '\0\0\0\0\0\0\0\0' >> %t.profraw
RUN: printf '\0\0\0\0\0\0\0\0' >> %t.profraw
RUN: printf '\0\0\0\0\0\0\0\0' >> %t.profraw
RUN: printf '\0\0\0\0\0\0\0\0' >> %t.profraw

// Binary IDs - There are only two in this case that are 20 bytes.
RUN: printf '\24\0\0\0\0\0\0\0' >> %t.profraw
RUN: printf '\0\1\2\3\4\5\6\7' >> %t.profraw
RUN: printf '\0\1\2\3\4\5\6\7' >> %t.profraw
RUN: printf '\0\1\2\3\0\0\0\0' >> %t.profraw
RUN: printf '\24\0\0\0\0\0\0\0' >> %t.profraw
RUN: printf '\1\1\1\1\1\1\1\1' >> %t.profraw
RUN: printf '\2\2\2\2\2\2\2\2' >> %t.profraw
RUN: printf '\3\3\3\3\0\0\0\0' >> %t.profraw

// RUN: not llvm-profdata show --binary-ids  %t.profraw 2>&1 | FileCheck %s
// CHECK: invalid instrumentation profile data (file header is corrupt)