<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, May 16, 2014 at 2:23 PM, Greg Fitzgerald <span dir="ltr"><<a href="mailto:garious@gmail.com" target="_blank">garious@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Cool, I was just looking at these.  Do you know what's wrong with GCC here?<br>
</blockquote><div><br></div><div>Well, GCC-ASan doesn't support certain sanitizer compile flags. Also,</div><div>GCC driver doesn't do the right thing for lines like:</div><div>  gcc -x c++ a.cc b.so</div><div>(it treats b.so as a source file).</div>
<div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
By the way, if you're planning on making this test suite usable with<br>
GCC, maybe call that feature "Clang-compiled-runtime" to avoid any<br>
confusion?<br></blockquote><div><br></div><div>Nope, it doesn't matter which compiler was used to build the runtime, this feature</div><div>is used to distinguish between the compiler/toolchain used to run the tests.</div>
<div><br></div><div>With this change, I'm able to run test-suite for GCC-ASan: <a href="https://code.google.com/p/address-sanitizer/wiki/AddressSanitizerTestSuite">https://code.google.com/p/address-sanitizer/wiki/AddressSanitizerTestSuite</a></div>
<div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<span class=""><font color="#888888"><br>
-Greg<br>
</font></span><div class=""><div class="h5"><br>
<br>
On Fri, May 16, 2014 at 1:12 PM, Alexey Samsonov <<a href="mailto:samsonov@google.com">samsonov@google.com</a>> wrote:<br>
> Author: samsonov<br>
> Date: Fri May 16 15:12:27 2014<br>
> New Revision: 209013<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=209013&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=209013&view=rev</a><br>
> Log:<br>
> Exclude several ASan tests from test suite if we're using GCC<br>
><br>
> Modified:<br>
>     compiler-rt/trunk/test/asan/TestCases/Linux/asan_prelink_test.cc<br>
>     compiler-rt/trunk/test/asan/TestCases/Linux/heavy_uar_test.cc<br>
>     compiler-rt/trunk/test/asan/TestCases/Linux/odr-violation.cc<br>
>     compiler-rt/trunk/test/asan/TestCases/Linux/preinit_test.cc<br>
>     compiler-rt/trunk/test/asan/TestCases/heap-overflow.cc<br>
>     compiler-rt/trunk/test/lit.common.cfg<br>
><br>
> Modified: compiler-rt/trunk/test/asan/TestCases/Linux/asan_prelink_test.cc<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/TestCases/Linux/asan_prelink_test.cc?rev=209013&r1=209012&r2=209013&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/TestCases/Linux/asan_prelink_test.cc?rev=209013&r1=209012&r2=209013&view=diff</a><br>

> ==============================================================================<br>
> --- compiler-rt/trunk/test/asan/TestCases/Linux/asan_prelink_test.cc (original)<br>
> +++ compiler-rt/trunk/test/asan/TestCases/Linux/asan_prelink_test.cc Fri May 16 15:12:27 2014<br>
> @@ -9,7 +9,8 @@<br>
>  // RUN: %clangxx_asan %t.o %t.so -Wl,-R. -o %t<br>
>  // RUN: ASAN_OPTIONS=verbosity=1 %run %t 2>&1 | FileCheck %s<br>
><br>
> -// REQUIRES: x86_64-supported-target, asan-64-bits<br>
> +// GNU driver doesn't handle .so files properly.<br>
> +// REQUIRES: x86_64-supported-target, asan-64-bits, Clang<br>
>  #if BUILD_SO<br>
>  int G;<br>
>  int *getG() {<br>
><br>
> Modified: compiler-rt/trunk/test/asan/TestCases/Linux/heavy_uar_test.cc<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/TestCases/Linux/heavy_uar_test.cc?rev=209013&r1=209012&r2=209013&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/TestCases/Linux/heavy_uar_test.cc?rev=209013&r1=209012&r2=209013&view=diff</a><br>

> ==============================================================================<br>
> --- compiler-rt/trunk/test/asan/TestCases/Linux/heavy_uar_test.cc (original)<br>
> +++ compiler-rt/trunk/test/asan/TestCases/Linux/heavy_uar_test.cc Fri May 16 15:12:27 2014<br>
> @@ -4,6 +4,9 @@<br>
>  // RUN: %clangxx_asan -O2 %s -o %t && \<br>
>  // RUN:   not %run %t 2>&1 | FileCheck %s<br>
><br>
> +// FIXME: Fix this test under GCC.<br>
> +// REQUIRES: Clang<br>
> +<br>
>  #include <stdio.h><br>
>  #include <string.h><br>
>  #include <stdlib.h><br>
><br>
> Modified: compiler-rt/trunk/test/asan/TestCases/Linux/odr-violation.cc<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/TestCases/Linux/odr-violation.cc?rev=209013&r1=209012&r2=209013&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/TestCases/Linux/odr-violation.cc?rev=209013&r1=209012&r2=209013&view=diff</a><br>

> ==============================================================================<br>
> --- compiler-rt/trunk/test/asan/TestCases/Linux/odr-violation.cc (original)<br>
> +++ compiler-rt/trunk/test/asan/TestCases/Linux/odr-violation.cc Fri May 16 15:12:27 2014<br>
> @@ -11,6 +11,9 @@<br>
>  // RUN: ASAN_OPTIONS=detect_odr_violation=1     %run %t 2>&1 | FileCheck %s --check-prefix=DISABLED<br>
>  // RUN: ASAN_OPTIONS=detect_odr_violation=2 not %run %t 2>&1 | FileCheck %s<br>
><br>
> +// GNU driver doesn't handle .so files properly.<br>
> +// REQUIRES: Clang<br>
> +<br>
>  #ifndef SZ<br>
>  # define SZ 4<br>
>  #endif<br>
><br>
> Modified: compiler-rt/trunk/test/asan/TestCases/Linux/preinit_test.cc<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/TestCases/Linux/preinit_test.cc?rev=209013&r1=209012&r2=209013&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/TestCases/Linux/preinit_test.cc?rev=209013&r1=209012&r2=209013&view=diff</a><br>

> ==============================================================================<br>
> --- compiler-rt/trunk/test/asan/TestCases/Linux/preinit_test.cc (original)<br>
> +++ compiler-rt/trunk/test/asan/TestCases/Linux/preinit_test.cc Fri May 16 15:12:27 2014<br>
> @@ -2,6 +2,9 @@<br>
>  // RUN: %clangxx_asan -DFUNC=main %s         -o %t    -Wl,-R. %t.so<br>
>  // RUN: %run %t<br>
><br>
> +// GNU driver doesn't handle .so files properly.<br>
> +// REQUIRES: Clang<br>
> +<br>
>  // This test ensures that we call __asan_init early enough.<br>
>  // We build a shared library w/o asan instrumentation<br>
>  // and the binary with asan instrumentation.<br>
><br>
> Modified: compiler-rt/trunk/test/asan/TestCases/heap-overflow.cc<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/TestCases/heap-overflow.cc?rev=209013&r1=209012&r2=209013&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/TestCases/heap-overflow.cc?rev=209013&r1=209012&r2=209013&view=diff</a><br>

> ==============================================================================<br>
> --- compiler-rt/trunk/test/asan/TestCases/heap-overflow.cc (original)<br>
> +++ compiler-rt/trunk/test/asan/TestCases/heap-overflow.cc Fri May 16 15:12:27 2014<br>
> @@ -3,6 +3,10 @@<br>
>  // RUN: %clangxx_asan -O2 %s -o %t && not %run %t 2>&1 | FileCheck %s<br>
>  // RUN: %clangxx_asan -O3 %s -o %t && not %run %t 2>&1 | FileCheck %s<br>
>  // RUN: ASAN_OPTIONS=print_stats=1 not %run %t 2>&1 | FileCheck %s<br>
> +<br>
> +// FIXME: Fix this test under GCC.<br>
> +// REQUIRES: Clang<br>
> +<br>
>  #include <stdlib.h><br>
>  #include <string.h><br>
>  int main(int argc, char **argv) {<br>
><br>
> Modified: compiler-rt/trunk/test/lit.common.cfg<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/lit.common.cfg?rev=209013&r1=209012&r2=209013&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/lit.common.cfg?rev=209013&r1=209012&r2=209013&view=diff</a><br>

> ==============================================================================<br>
> --- compiler-rt/trunk/test/lit.common.cfg (original)<br>
> +++ compiler-rt/trunk/test/lit.common.cfg Fri May 16 15:12:27 2014<br>
> @@ -28,6 +28,8 @@ elif compiler_id == 'GNU':<br>
>    config.cxx_mode_flags = ["-x c++"]<br>
>  else:<br>
>    lit_config.fatal("Unsupported compiler id: %r" % compiler_id)<br>
> +# Add compiler ID to the list of available features.<br>
> +config.available_features.add(compiler_id)<br>
><br>
>  # Clear some environment variables that might affect Clang.<br>
>  possibly_dangerous_env_vars = ['COMPILER_PATH', 'RC_DEBUG_OPTIONS',<br>
><br>
><br>
> _______________________________________________<br>
> llvm-commits mailing list<br>
> <a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr"><div>Alexey Samsonov, Mountain View, CA</div></div>
</div></div>