1 // Test __llvm_profile_get_filename.
2 // RUN: %clang_pgogen -O2 -o %t %s
8 const char *__llvm_profile_get_filename();
9 void __llvm_profile_set_filename(const char *);
11 int main(int argc
, const char *argv
[]) {
14 const char *new_filename
= "/path/to/test.profraw";
16 filename
= __llvm_profile_get_filename();
17 if (strncmp(filename
, "default_", 8)) {
19 "Error: got filename %s, expected it to start with 'default_'\n",
23 if (strcmp(filename
+ strlen(filename
) - strlen(".profraw"), ".profraw")) {
25 "Error: got filename %s, expected it to end with '.profraw'\n",
30 __llvm_profile_set_filename(new_filename
);
31 filename
= __llvm_profile_get_filename();
32 if (strcmp(filename
, new_filename
)) {
33 fprintf(stderr
, "Error: got filename %s, expected '%s'\n", filename
,