diff --git a/lldb/lit/BuildScript/compiler-full-path.test b/lldb/lit/BuildScript/compiler-full-path.test new file mode 100644 index 0000000000000..f8906d952f2c9 --- /dev/null +++ b/lldb/lit/BuildScript/compiler-full-path.test @@ -0,0 +1,10 @@ +RUN: %build -n --verbose --arch=64 --compiler=/path/to/my/clang -o foo \ +RUN: foobar.c | FileCheck %s --check-prefix=CHECK-CLANG +RUN: %build -n --verbose --arch=64 --compiler=/path/to/my/x64/cl.exe -o foo \ +RUN: foobar.c | FileCheck %s --check-prefix=CHECK-MSVC + +CHECK-CLANG: Command Line: /path/to/my/clang +CHECK-SAME: -o + +CHECK-MSVC: Command Line: /path/to/my/x64/cl.exe +CHECK-SAME: /Fo diff --git a/lldb/lit/helper/build.py b/lldb/lit/helper/build.py index d82c688de7bc2..d2cb52f00e553 100755 --- a/lldb/lit/helper/build.py +++ b/lldb/lit/helper/build.py @@ -207,16 +207,16 @@ def find_toolchain(compiler, tools_dir): file = os.path.basename(compiler) name, ext = os.path.splitext(file) if file.lower() == 'cl.exe': - return 'msvc' + return ('msvc', compiler) if name == 'clang-cl': - return 'clang-cl' + return ('clang-cl', compiler) if name.startswith('clang'): - return 'clang' + return ('clang', compiler) if name.startswith('gcc') or name.startswith('g++'): - return 'gcc' + return ('gcc', compiler) if name == 'cc' or name == 'c++': - return 'generic' - return 'unknown' + return ('generic', compiler) + return ('unknown', compiler) class Builder(object): def __init__(self, toolchain_type, args, obj_ext):