diff --git a/clang/test/CodeGen/debug-prefix-map.c b/clang/test/CodeGen/debug-prefix-map.c --- a/clang/test/CodeGen/debug-prefix-map.c +++ b/clang/test/CodeGen/debug-prefix-map.c @@ -1,10 +1,10 @@ -// RUN: %clang_cc1 -debug-info-kind=standalone -fdebug-prefix-map=%p=/UNLIKELY_PATH/empty %s -emit-llvm -o - | FileCheck %s -check-prefix CHECK-NO-MAIN-FILE-NAME -// RUN: %clang_cc1 -debug-info-kind=standalone -fdebug-prefix-map=%p=/UNLIKELY_PATH=empty %s -emit-llvm -o - | FileCheck %s -check-prefix CHECK-EVIL -// RUN: %clang_cc1 -debug-info-kind=standalone -fdebug-prefix-map=%p=/UNLIKELY_PATH/empty %s -emit-llvm -o - -main-file-name debug-prefix-map.c | FileCheck %s -// RUN: %clang_cc1 -debug-info-kind=standalone -fdebug-prefix-map=%p=/UNLIKELY_PATH/empty %s -emit-llvm -o - -fdebug-compilation-dir %p | FileCheck %s -check-prefix CHECK-COMPILATION-DIR -// RUN: %clang_cc1 -debug-info-kind=standalone -fdebug-prefix-map=%p=/UNLIKELY_PATH/empty %s -emit-llvm -o - -isysroot %p -debugger-tuning=lldb | FileCheck %s -check-prefix CHECK-SYSROOT -// RUN: %clang -g -fdebug-prefix-map=%p=/UNLIKELY_PATH/empty -S -c %s -emit-llvm -o - | FileCheck %s -// RUN: %clang -g -ffile-prefix-map=%p=/UNLIKELY_PATH/empty -S -c %s -emit-llvm -o - | FileCheck %s +// RUN: %clang_cc1 -debug-info-kind=standalone -fdebug-prefix-map=%p=%{rootsep}UNLIKELY_PATH%{sep}empty %s -emit-llvm -o - | FileCheck %s -check-prefix CHECK-NO-MAIN-FILE-NAME +// RUN: %clang_cc1 -debug-info-kind=standalone -fdebug-prefix-map=%p=%{rootsep}UNLIKELY_PATH=empty %s -emit-llvm -o - | FileCheck %s -check-prefix CHECK-EVIL +// RUN: %clang_cc1 -debug-info-kind=standalone -fdebug-prefix-map=%p=%{rootsep}UNLIKELY_PATH%{sep}empty %s -emit-llvm -o - -main-file-name debug-prefix-map.c | FileCheck %s +// RUN: %clang_cc1 -debug-info-kind=standalone -fdebug-prefix-map=%p=%{rootsep}UNLIKELY_PATH%{sep}empty %s -emit-llvm -o - -fdebug-compilation-dir %p | FileCheck %s -check-prefix CHECK-COMPILATION-DIR +// RUN: %clang_cc1 -debug-info-kind=standalone -fdebug-prefix-map=%p=%{rootsep}UNLIKELY_PATH%{sep}empty %s -emit-llvm -o - -isysroot %p -debugger-tuning=lldb | FileCheck %s -check-prefix CHECK-SYSROOT +// RUN: %clang -g -fdebug-prefix-map=%p=%{rootsep}UNLIKELY_PATH%{sep}empty -S -c %s -emit-llvm -o - | FileCheck %s +// RUN: %clang -g -ffile-prefix-map=%p=%{rootsep}UNLIKELY_PATH%{sep}empty -S -c %s -emit-llvm -o - | FileCheck %s #include "Inputs/stdio.h" diff --git a/clang/test/lit.cfg.py b/clang/test/lit.cfg.py --- a/clang/test/lit.cfg.py +++ b/clang/test/lit.cfg.py @@ -56,6 +56,16 @@ config.substitutions.append(('%PATH%', config.environment['PATH'])) +if platform.system() == 'Windows': + root_sep = 'C:\\' +else: + root_sep = os.path.sep + +config.substitutions.extend([ + ('%{rootsep}', root_sep), + ('%{sep}', os.path.sep), +]) + # For each occurrence of a clang tool name, replace it with the full path to # the build directory holding that tool. We explicitly specify the directories # to search to ensure that we get the tools just built and not some random