<div dir="ltr">Thanks!<div><a href="https://reviews.llvm.org/rG149d5a8c4793">https://reviews.llvm.org/rG149d5a8c4793</a></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, 22 Apr 2021 at 04:57, Yvan Roux <<a href="mailto:yvan.roux@linaro.org">yvan.roux@linaro.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi,<div><br></div><div>this new test broke armv7 bots:</div><div><br></div><div><a href="https://lab.llvm.org/buildbot/#/builders/59/builds/1725" target="_blank">https://lab.llvm.org/buildbot/#/builders/59/builds/1725</a><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, 21 Apr 2021 at 07:00, Vitaly Buka via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
Author: Vitaly Buka<br>
Date: 2021-04-20T22:00:26-07:00<br>
New Revision: 5e9e463e1fdd7980992ffc5bf78894e0f39d5d9c<br>
<br>
URL: <a href="https://github.com/llvm/llvm-project/commit/5e9e463e1fdd7980992ffc5bf78894e0f39d5d9c" rel="noreferrer" target="_blank">https://github.com/llvm/llvm-project/commit/5e9e463e1fdd7980992ffc5bf78894e0f39d5d9c</a><br>
DIFF: <a href="https://github.com/llvm/llvm-project/commit/5e9e463e1fdd7980992ffc5bf78894e0f39d5d9c.diff" rel="noreferrer" target="_blank">https://github.com/llvm/llvm-project/commit/5e9e463e1fdd7980992ffc5bf78894e0f39d5d9c.diff</a><br>
<br>
LOG: [lsan] Test to show lsan dependency on globals<br>
<br>
This test from @MaskRay comment on D69428. The patch is looking to<br>
break this behavior. If we go with D69428 I hope we will have some<br>
workaround for this test or include explicit test update into the patch.<br>
<br>
Reviewed By: MaskRay<br>
<br>
Differential Revision: <a href="https://reviews.llvm.org/D100906" rel="noreferrer" target="_blank">https://reviews.llvm.org/D100906</a><br>
<br>
Added: <br>
    compiler-rt/test/lsan/TestCases/use_globals_unused.cpp<br>
<br>
Modified: <br>
<br>
<br>
Removed: <br>
<br>
<br>
<br>
################################################################################<br>
diff  --git a/compiler-rt/test/lsan/TestCases/use_globals_unused.cpp b/compiler-rt/test/lsan/TestCases/use_globals_unused.cpp<br>
new file mode 100644<br>
index 0000000000000..06f2616842b5b<br>
--- /dev/null<br>
+++ b/compiler-rt/test/lsan/TestCases/use_globals_unused.cpp<br>
@@ -0,0 +1,39 @@<br>
+// Test that unused globals are included in the root set.<br>
+// RUN: %clangxx_lsan -O2 %s -DTEST_LIB -c -o %t.o<br>
+// RUN: %clangxx_lsan -O2 %s %t.o -o %t<br>
+// RUN: LSAN_BASE="use_stacks=0:use_registers=0"<br>
+// RUN: %env_lsan_opts=$LSAN_BASE:"use_globals=0" not %run %t 2>&1 | FileCheck %s --check-prefixes=LEAK<br>
+// RUN: %env_lsan_opts=$LSAN_BASE:"use_globals=1" %run %t 2>&1 | FileCheck %s --implicit-check-not=leak<br>
+// RUN: %env_lsan_opts="" %run %t 2>&1 | FileCheck %s --implicit-check-not=leak<br>
+<br>
+#include <stdio.h><br>
+#include <stdlib.h><br>
+#include <string.h><br>
+<br>
+#ifdef TEST_LIB<br>
+<br>
+void set(char *a) {<br>
+  strcpy(a, "hello");<br>
+}<br>
+<br>
+#else<br>
+<br>
+static void *g;<br>
+<br>
+void set(char *a);<br>
+void foo(void *a) {<br>
+  // Store from a <br>
diff erent function to suppress global localization.<br>
+  g = a;<br>
+}<br>
+<br>
+int main() {<br>
+  char a[10];<br>
+  set(a);<br>
+  char *b = strdup(a);<br>
+  printf("%p %s\n", b, b);<br>
+  g = b;<br>
+}<br>
+<br>
+#endif<br>
+<br>
+// LEAK: LeakSanitizer: detected memory leaks<br>
<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="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div>
</blockquote></div>