3 // INSTR_PROF_RAW_HEADER(uint64_t, Magic, __llvm_profile_get_magic())
4 // INSTR_PROF_RAW_HEADER(uint64_t, Version, __llvm_profile_get_version())
5 // INSTR_PROF_RAW_HEADER(uint64_t, BinaryIdsSize, __llvm_write_binary_ids(NULL))
6 // INSTR_PROF_RAW_HEADER(uint64_t, DataSize, DataSize)
7 // INSTR_PROF_RAW_HEADER(uint64_t, CountersSize, CountersSize)
8 // INSTR_PROF_RAW_HEADER(uint64_t, NamesSize, NamesSize)
9 // INSTR_PROF_RAW_HEADER(uint64_t, CountersDelta, (uintptr_t)CountersBegin)
10 // INSTR_PROF_RAW_HEADER(uint64_t, NamesDelta, (uintptr_t)NamesBegin)
11 // INSTR_PROF_RAW_HEADER(uint64_t, ValueKindLast, IPVK_Last)
13 RUN: printf '\201rforpl\377' > %t.profraw
14 RUN: printf '\10\0\0\0\0\0\0\0' >> %t.profraw
15 RUN: printf '\0\0\0\0\0\0\0\0' >> %t.profraw
16 RUN: printf '\1\0\0\0\0\0\0\0' >> %t.profraw
17 RUN: printf '\0\0\0\0\0\0\0\0' >> %t.profraw
18 RUN: printf '\1\0\0\0\0\0\0\0' >> %t.profraw
19 RUN: printf '\0\0\0\0\0\0\0\0' >> %t.profraw
20 RUN: printf '\10\0\0\0\0\0\0\0' >> %t.profraw
21 RUN: printf '\0\0\4\0\1\0\0\0' >> %t.profraw
22 RUN: printf '\0\0\4\0\2\0\0\0' >> %t.profraw
23 RUN: printf '\0\0\0\0\0\0\0\0' >> %t.profraw
28 // #define INSTR_PROF_DATA(Type, LLVMType, Name, Initializer) \
30 // #include "llvm/ProfileData/InstrProfData.inc"
33 RUN: printf '\254\275\030\333\114\302\370\134' >> %t.profraw
34 RUN: printf '\1\0\0\0\0\0\0\0' >> %t.profraw
35 RUN: printf '\0\0\4\0\1\0\0\0' >> %t.profraw
36 RUN: printf '\0\0\0\0\0\0\0\0' >> %t.profraw
37 RUN: printf '\0\0\0\0\0\0\0\0' >> %t.profraw
38 // Make NumCounters = 0 so that we get "number of counters is zero" error message
39 RUN: printf '\0\0\0\0\0\0\0\0' >> %t.profraw
41 RUN: printf '\023\0\0\0\0\0\0\0' >> %t.profraw
42 RUN: printf '\3\0foo\0\0\0' >> %t.profraw
44 RUN: not llvm-profdata show %t.profraw 2>&1 | FileCheck %s
45 CHECK: malformed instrumentation profile data: number of counters is zero