• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Test __llvm_profile_get_filename when the on-line merging mode is enabled.
2 //
3 // RUN: %clang_pgogen -fPIC -shared -o %t.dso %p/../Inputs/instrprof-get-filename-dso.c
4 // RUN: %clang_pgogen -o %t %s %t.dso
5 // RUN: env LLVM_PROFILE_FILE="%t-%m.profraw" %run %t
6 
7 #include <string.h>
8 
9 const char *__llvm_profile_get_filename(void);
10 extern const char *get_filename_from_DSO(void);
11 
main(int argc,const char * argv[])12 int main(int argc, const char *argv[]) {
13   const char *filename1 = __llvm_profile_get_filename();
14   const char *filename2 = get_filename_from_DSO();
15 
16   // Exit with code 1 if the two filenames are the same.
17   return strcmp(filename1, filename2) == 0;
18 }
19