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