mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-25 08:16:05 +00:00

This fixes two problems: 1. When crossing compiling for windows on linux, source file path in debug info is concatenated with directory by host native separator ('/'). For windows local build, they are concatenated by '\'. This causes non-determinism bug. The solution here is to let `LangOptions.UseTargetPathSeparator` to control if we should use host native separator or not. 2. Objectfile path in CodeView also uses host native separator when generated. It's fixed by changing the path separator in `/Fo` to '\' if the path is not an absolute path when adding the `-object-file-name=` flag. Reviewed By: hans Differential Revision: https://reviews.llvm.org/D147256
7 lines
380 B
C
7 lines
380 B
C
// RUN: %clang -target x86_64-pc-win32 -ffile-reproducible -emit-llvm -S -g %s -o - | FileCheck --check-prefix=WIN %s
|
|
// RUN: %clang -target x86_64-linux-gnu -ffile-reproducible -emit-llvm -S -g %s -o - | FileCheck --check-prefix=LINUX %s
|
|
int main() { return 0; }
|
|
|
|
// WIN: !DIFile(filename: "{{.*}}\\debug-info-slash.c"
|
|
// LINUX: !DIFile(filename: "{{.*}}/debug-info-slash.c"
|