aboutsummaryrefslogtreecommitdiff
path: root/test/profile/Linux/instrprof-dir.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/profile/Linux/instrprof-dir.c')
-rw-r--r--test/profile/Linux/instrprof-dir.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/profile/Linux/instrprof-dir.c b/test/profile/Linux/instrprof-dir.c
new file mode 100644
index 000000000000..9d9af6daf513
--- /dev/null
+++ b/test/profile/Linux/instrprof-dir.c
@@ -0,0 +1,13 @@
+// RUN: %clang_pgogen -o %t %s
+// RUN: env LLVM_PROFILE_FILE="%t.d/%m.profraw"
+// RUN: rm -fr %t.d
+// RUN: %run %t %t.d
+
+#include <errno.h>
+#include <unistd.h>
+
+int main(int argc, char **argv) {
+ if (access(argv[1], F_OK) == 0)
+ return 1; // %t.d should not exist yet.
+ return !(errno == ENOENT);
+}