<div dir="ltr">I added %stdcxx11 to try to address this in r276454, PTAL. Also consider using it when adding tests that use C++11.</div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jul 21, 2016 at 9:42 PM, Kostya Serebryany <span dir="ltr"><<a href="mailto:kcc@google.com" target="_blank">kcc@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">r276379: <div>[asan] revert to using -std=c++11 on  test/asan/TestCases/use-after-scope-capture.cc to fix Linux failures after r276332. This probably breaks the windows build, sorry, but returns to the earlier status quo. <br></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jul 21, 2016 at 2:45 PM, Kostya Serebryany <span dir="ltr"><<a href="mailto:kcc@google.com" target="_blank">kcc@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">this breaks the linix build: <div><br></div><div><div>In file included from /usr/local/google/home/kcc/llvm/projects/compiler-rt/test/asan/TestCases/use-after-scope-capture.cc:4:</div><div>In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/functional:55:</div><div>In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/tuple:39:</div><div>In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/array:38:</div><div>In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/stdexcept:39:</div><div>In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/string:52:</div><div>In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/bits/basic_string.h:2815:</div><div>In file included from /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/ext/string_conversions.h:43:</div><div>/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../../include/c++/4.8/cstdio:120:11: error: no member named 'gets' in the global namespace</div><div>  using ::gets;</div><div>        ~~^</div><div>1 error generated.</div></div><div><br></div></div><div class="m_7101455791034060102HOEnZb"><div class="m_7101455791034060102h5"><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jul 21, 2016 at 2:04 PM, Reid Kleckner via llvm-commits <span dir="ltr"><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: rnk<br>
Date: Thu Jul 21 16:04:34 2016<br>
New Revision: 276332<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=276332&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=276332&view=rev</a><br>
Log:<br>
[asan] Fix Win64 test portability issues<br>
<br>
The OOM test should really only run on 32-bits, since it's hard to OOM<br>
on x64.<br>
<br>
The operator_array_new_with_dtor_left_oob tests need to account for the<br>
larger array cookie on x64 (8 bytes instead of 4).<br>
<br>
Use -std=c++14 in use-after-scope-capture.cc to avoid errors in the MSVC<br>
2015 STL on Windows. The default there is C++14 anyway.<br>
<br>
Modified:<br>
    compiler-rt/trunk/test/asan/TestCases/Windows/dll_operator_array_new_with_dtor_left_oob.cc<br>
    compiler-rt/trunk/test/asan/TestCases/Windows/oom.cc<br>
    compiler-rt/trunk/test/asan/TestCases/Windows/operator_array_new_with_dtor_left_oob.cc<br>
    compiler-rt/trunk/test/asan/TestCases/use-after-scope-capture.cc<br>
<br>
Modified: compiler-rt/trunk/test/asan/TestCases/Windows/dll_operator_array_new_with_dtor_left_oob.cc<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/TestCases/Windows/dll_operator_array_new_with_dtor_left_oob.cc?rev=276332&r1=276331&r2=276332&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/TestCases/Windows/dll_operator_array_new_with_dtor_left_oob.cc?rev=276332&r1=276331&r2=276332&view=diff</a><br>
==============================================================================<br>
--- compiler-rt/trunk/test/asan/TestCases/Windows/dll_operator_array_new_with_dtor_left_oob.cc (original)<br>
+++ compiler-rt/trunk/test/asan/TestCases/Windows/dll_operator_array_new_with_dtor_left_oob.cc Thu Jul 21 16:04:34 2016<br>
@@ -10,7 +10,7 @@ struct C {<br>
 extern "C" __declspec(dllexport)<br>
 int test_function() {<br>
   C *buffer = new C[42];<br>
-  buffer[-2].x = 42;<br>
+  buffer[-(1 + sizeof(void*) / 4)].x = 42;<br>
 // CHECK: AddressSanitizer: heap-buffer-overflow on address [[ADDR:0x[0-9a-f]+]]<br>
 // CHECK: WRITE of size 4 at [[ADDR]] thread T0<br>
 // CHECK-NEXT: test_function {{.*}}dll_operator_array_new_with_dtor_left_oob.cc:[[@LINE-3]]<br>
@@ -19,7 +19,7 @@ int test_function() {<br>
 // FIXME: Currently it says "4 bytes ... left of 172-byte region",<br>
 //        should be "8 bytes ... left of 168-byte region", see<br>
 //        <a href="https://code.google.com/p/address-sanitizer/issues/detail?id=314" rel="noreferrer" target="_blank">https://code.google.com/p/address-sanitizer/issues/detail?id=314</a><br>
-// CHECK: [[ADDR]] is located {{.*}} bytes to the left of 172-byte region<br>
+// CHECK: [[ADDR]] is located {{.*}} bytes to the left of {{(172|176)}}-byte region<br>
 // FIXME: Should get rid of the malloc/free frames called from the inside of<br>
 // operator new/delete in DLLs when using -MT CRT.<br>
 // FIXME: The operator new frame should have [].<br>
<br>
Modified: compiler-rt/trunk/test/asan/TestCases/Windows/oom.cc<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/TestCases/Windows/oom.cc?rev=276332&r1=276331&r2=276332&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/TestCases/Windows/oom.cc?rev=276332&r1=276331&r2=276332&view=diff</a><br>
==============================================================================<br>
--- compiler-rt/trunk/test/asan/TestCases/Windows/oom.cc (original)<br>
+++ compiler-rt/trunk/test/asan/TestCases/Windows/oom.cc Thu Jul 21 16:04:34 2016<br>
@@ -1,5 +1,6 @@<br>
 // RUN: %clang_cl_asan -O0 %s -Fe%t<br>
 // RUN: not %run %t 2>&1 | FileCheck %s<br>
+// REQUIRES: asan-32-bits<br>
<br>
 #include <malloc.h><br>
<br>
<br>
Modified: compiler-rt/trunk/test/asan/TestCases/Windows/operator_array_new_with_dtor_left_oob.cc<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/TestCases/Windows/operator_array_new_with_dtor_left_oob.cc?rev=276332&r1=276331&r2=276332&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/TestCases/Windows/operator_array_new_with_dtor_left_oob.cc?rev=276332&r1=276331&r2=276332&view=diff</a><br>
==============================================================================<br>
--- compiler-rt/trunk/test/asan/TestCases/Windows/operator_array_new_with_dtor_left_oob.cc (original)<br>
+++ compiler-rt/trunk/test/asan/TestCases/Windows/operator_array_new_with_dtor_left_oob.cc Thu Jul 21 16:04:34 2016<br>
@@ -8,7 +8,7 @@ struct C {<br>
<br>
 int main() {<br>
   C *buffer = new C[42];<br>
-  buffer[-2].x = 42;<br>
+  buffer[-(1 + sizeof(void*) / 4)].x = 42;<br>
 // CHECK: AddressSanitizer: heap-buffer-overflow on address [[ADDR:0x[0-9a-f]+]]<br>
 // CHECK: WRITE of size 4 at [[ADDR]] thread T0<br>
 // CHECK-NEXT: {{#0 .* main .*operator_array_new_with_dtor_left_oob.cc}}:[[@LINE-3]]<br>
@@ -16,7 +16,7 @@ int main() {<br>
 // FIXME: Currently it says "4 bytes ... left of 172-byte region",<br>
 //        should be "8 bytes ... left of 168-byte region", see<br>
 //        <a href="https://code.google.com/p/address-sanitizer/issues/detail?id=314" rel="noreferrer" target="_blank">https://code.google.com/p/address-sanitizer/issues/detail?id=314</a><br>
-// CHECK: [[ADDR]] is located {{.*}} bytes to the left of 172-byte region<br>
+// CHECK: [[ADDR]] is located {{.*}} bytes to the left of {{(172|176)}}-byte region<br>
 // CHECK-LABEL: allocated by thread T0 here:<br>
 // FIXME: The 'operator new' frame should have [].<br>
 // CHECK-NEXT: {{#0 .* operator new}}<br>
<br>
Modified: compiler-rt/trunk/test/asan/TestCases/use-after-scope-capture.cc<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/TestCases/use-after-scope-capture.cc?rev=276332&r1=276331&r2=276332&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/test/asan/TestCases/use-after-scope-capture.cc?rev=276332&r1=276331&r2=276332&view=diff</a><br>
==============================================================================<br>
--- compiler-rt/trunk/test/asan/TestCases/use-after-scope-capture.cc (original)<br>
+++ compiler-rt/trunk/test/asan/TestCases/use-after-scope-capture.cc Thu Jul 21 16:04:34 2016<br>
@@ -1,4 +1,4 @@<br>
-// RUN: %clangxx_asan -std=c++11 -O1 -fsanitize-address-use-after-scope %s -o %t && \<br>
+// RUN: %clangxx_asan -std=c++14 -O1 -fsanitize-address-use-after-scope %s -o %t && \<br>
 // RUN:     not %run %t 2>&1 | FileCheck %s<br>
<br>
 #include <functional><br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>