[compiler-rt] [compiler-rt][profile] Accept Unicode profile names on Windows (PR #202335)

William Woodruff via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 8 06:34:33 PDT 2026


================
@@ -0,0 +1,22 @@
+// RUN: %clang_profgen -o %t.exe %s
+// RUN: rm -rf %t.dir
+// RUN: mkdir %t.dir
+// RUN: cd %t.dir
+// RUN: %run %t.exe
+
+#include <stdio.h>
+#include <windows.h>
+
+extern FILE *lprofOpenFileEx(const char *);
+
+int main(void) {
+  const char *Filename = "profile-\xe6\x97\xa5.dump";
+  FILE *File = lprofOpenFileEx(Filename);
+  if (!File)
+    return 1;
+
+  fputs("profile data", File);
+  fclose(File);
+
+  return GetFileAttributesW(L"profile-\u65e5.dump") == INVALID_FILE_ATTRIBUTES;
----------------
woodruffw wrote:

NB: This tests that the file is reachable by its UTF-16 filename, after being opened/created as UTF-8.

https://github.com/llvm/llvm-project/pull/202335


More information about the llvm-commits mailing list