brintos

brintos / llvm-project-archived public Read only

0
0
Text · 3.7 KiB · cc3e6c3 Raw
89 lines · plain
1// Header2//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, NumBitmaskBytes, NumBitmaskBytes)9// INSTR_PROF_RAW_HEADER(uint64_t, NamesSize,  NamesSize)10// INSTR_PROF_RAW_HEADER(uint64_t, CountersDelta, (uintptr_t)CountersBegin)11// INSTR_PROF_RAW_HEADER(uint64_t, BitmaskDelta, (uintptr_t)BitmaskBegin)12// INSTR_PROF_RAW_HEADER(uint64_t, NamesDelta, (uintptr_t)NamesBegin)13// INSTR_PROF_RAW_HEADER(uint64_t, VNamesSize, VNamesSize)14// INSTR_PROF_RAW_HEADER(uint64_t, NumVTables, NumVTables)15// INSTR_PROF_RAW_HEADER(uint64_t, ValueKindLast, IPVK_Last)16 17// gnuwin32 printf does not work for this test because it will print \15 (CR)18// whenever \12 (LF) is in the input string.19UNSUPPORTED: system-windows20RUN: printf '\201rforpl\377' > %t.profraw21RUN: printf '\12\0\0\0\0\0\0\0' >> %t.profraw22// There will be 2 20-byte binary IDs, so the total Binary IDs size will be 64 bytes.23//   2 * 8  binary ID sizes24// + 2 * 20 binary IDs (of size 20)25// + 2 * 4  binary ID paddings26// --------27// = 64     bytes28RUN: printf '\100\0\0\0\0\0\0\0' >> %t.profraw29RUN: printf '\2\0\0\0\0\0\0\0' >> %t.profraw30RUN: printf '\0\0\0\0\0\0\0\0' >> %t.profraw31RUN: printf '\3\0\0\0\0\0\0\0' >> %t.profraw32RUN: printf '\0\0\0\0\0\0\0\0' >> %t.profraw33RUN: printf '\0\0\0\0\0\0\0\0' >> %t.profraw34RUN: printf '\0\0\0\0\0\0\0\0' >> %t.profraw35RUN: printf '\20\0\0\0\0\0\0\0' >> %t.profraw36RUN: printf '\0\0\4\0\1\0\0\0' >> %t.profraw37RUN: printf '\0\0\0\0\0\0\0\0' >> %t.profraw38RUN: printf '\0\0\4\0\2\0\0\0' >> %t.profraw39RUN: printf '\0\0\0\0\0\0\0\0' >> %t.profraw40RUN: printf '\0\0\0\0\0\0\0\0' >> %t.profraw41RUN: printf '\0\0\0\0\0\0\0\0' >> %t.profraw42 43// Binary IDs - There are only two in this case that are 20 bytes.44RUN: printf '\24\0\0\0\0\0\0\0' >> %t.profraw45RUN: printf '\0\1\2\3\4\5\6\7' >> %t.profraw46RUN: printf '\0\1\2\3\4\5\6\7' >> %t.profraw47RUN: printf '\0\1\2\3\0\0\0\0' >> %t.profraw48RUN: printf '\24\0\0\0\0\0\0\0' >> %t.profraw49RUN: printf '\1\1\1\1\1\1\1\1' >> %t.profraw50RUN: printf '\2\2\2\2\2\2\2\2' >> %t.profraw51RUN: printf '\3\3\3\3\0\0\0\0' >> %t.profraw52 53// Data Section54//55// struct ProfData {56// #define INSTR_PROF_DATA(Type, LLVMType, Name, Initializer) \57//    Type Name;58// #include "llvm/ProfileData/InstrProfData.inc"59// };60 61RUN: printf '\254\275\030\333\114\302\370\134' >> %t.profraw62RUN: printf '\1\0\0\0\0\0\0\0' >> %t.profraw63RUN: printf '\0\0\4\0\1\0\0\0' >> %t.profraw64RUN: printf '\0\0\0\0\0\0\0\0' >> %t.profraw65RUN: printf '\0\0\0\0\0\0\0\0' >> %t.profraw66RUN: printf '\0\0\0\0\0\0\0\0' >> %t.profraw67RUN: printf '\1\0\0\0\0\0\0\0' >> %t.profraw68RUN: printf '\0\0\0\0\0\0\0\0' >> %t.profraw69 70RUN: printf '\067\265\035\031\112\165\023\344' >> %t.profraw71RUN: printf '\02\0\0\0\0\0\0\0' >> %t.profraw72RUN: printf '\310\377\3\0\1\0\0\0' >> %t.profraw73RUN: printf '\0\0\0\0\0\0\0\0' >> %t.profraw74RUN: printf '\0\0\0\0\0\0\0\0' >> %t.profraw75RUN: printf '\0\0\0\0\0\0\0\0' >> %t.profraw76RUN: printf '\02\0\0\0\0\0\0\0' >> %t.profraw77RUN: printf '\0\0\0\0\0\0\0\0' >> %t.profraw78 79RUN: printf '\023\0\0\0\0\0\0\0' >> %t.profraw80RUN: printf '\067\0\0\0\0\0\0\0' >> %t.profraw81RUN: printf '\101\0\0\0\0\0\0\0' >> %t.profraw82RUN: printf '\7\0foo\1bar\0\0\0\0\0\0\0' >> %t.profraw83 84// RUN: llvm-profdata show --binary-ids  %t.profraw | FileCheck %s85// CHECK: Instrumentation level: Front-end86// CHECK: Binary IDs:87// CHECK-NEXT: 000102030405060700010203040506070001020388// CHECK-NEXT: 010101010101010102020202020202020303030389