]>
git.proxmox.com Git - rustc.git/blob - src/compiler-rt/test/profile/Inputs/instrprof-merge-match.c
5 int __llvm_profile_runtime
= 0;
6 uint64_t __llvm_profile_get_size_for_buffer(void);
7 int __llvm_profile_write_buffer(char *);
8 void __llvm_profile_reset_counters(void);
9 int __llvm_profile_check_compatibility(const char *, uint64_t);
19 extern uint64_t libEntry(char *Buffer
, uint64_t MaxSize
);
21 int main(int argc
, const char *argv
[]) {
22 const uint64_t MaxSize
= 10000;
23 static char Buffer
[MaxSize
];
25 uint64_t Size
= __llvm_profile_get_size_for_buffer();
29 __llvm_profile_reset_counters();
32 if (__llvm_profile_write_buffer(Buffer
))
35 /* Now check compatibility. Should return 0. */
36 if (__llvm_profile_check_compatibility(Buffer
, Size
))
39 /* Clear the buffer. */
40 memset(Buffer
, 0, MaxSize
);
42 /* Collect profile from shared library. */
43 Size
= libEntry(Buffer
, MaxSize
);
48 /* Shared library's profile should not match main executable's. */
49 if (!__llvm_profile_check_compatibility(Buffer
, Size
))