[PATCH] clang-cl: Add support for -o

Alp Toker alp at nuanti.com
Mon May 19 05:37:29 PDT 2014


On 19/05/2014 15:10, Timur Iskhodzhanov wrote:
> 2014-05-15 11:00 GMT+04:00 Reid Kleckner <rnk at google.com>:
>> Maybe we should just run these tests with the gcc driver frontend.
> So the problem with that is a combination of the following factors:
> a) The ASan lit tests use RUN lines like "%clangxx_asan %s -o %t"
>    [e.g. see test/asan/TestCases/stack-buffer-overflow.cc]
>
> b) The clang-cl driver doesn't support "-o"
>
> c) By default, %clangxx_asan is COMPILER_RT_TEST_COMPILER
>
> d) We have to use clang-cl to build ASan gtest-based tests as gtest
> itself uses exceptions.
>    Currently clang doesn't support exception, thus clang-cl falls back.
>
> e) COMPILER_RT_TEST_COMPILER is apparently used to build gtest-based tests
>    [see cmake/Modules/CompilerRTCompile.cmake]
>
>
> Looks like making any of (a-c,e) false fixes the problems.
>
> Possible solutions are (at least):
> A) Use a %exe_out macro in asan lit tests.
>    This implies a big (yet trivial) diff and a small-but-annoying
> maintenance burden for new tests.
>
> B) Add "-o" support to clang-cl, this is being discussed here.
>
> C) We can un-override %clangxx_asan to be clang rather than clang-cl on Windows
>    Or we could use a wrapper for clang-cl which replaces "-o" with
> "-Fo" when lit tests are run...
>    (there's a "android_commands/android_compile.py" wrapper around anyways)
>
> E) We could set COMPILER_RT_TEST_COMPILER to clang (rather than
> clang-cl) and override it for gtest-based tests.

It's fine, even expected to use different a compilers in lit tests than 
what's used in unit tests.

E is sounding good -- if the standard driver doesn't work for some 
reason just say so we can fix forward, after all sane cross-platform 
defaults are a design goal (unlike with clang-cl).

Alp.

>
> Opinions?

-- 
http://www.nuanti.com
the browser experts




More information about the cfe-commits mailing list