[llvm-branch-commits] [clang-tools-extra] [llvm] [clang] [sanitizer_symbolizer] Add end to end test for symbolizer markup. (PR #77702)
via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Wed Jan 10 15:33:38 PST 2024
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff a0ec54f71d12e29d88c24dc8f0482ee4bc26cf0e 27fb627cc2a1c35140f6665d184ce544a73b8ea1 -- compiler-rt/test/asan/TestCases/use-after-free-symbolizer-markup.cpp compiler-rt/test/tsan/simple_stack_symbolizer_markup.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/compiler-rt/test/asan/TestCases/use-after-free-symbolizer-markup.cpp b/compiler-rt/test/asan/TestCases/use-after-free-symbolizer-markup.cpp
index 548ae57b5c..5b46ced2f4 100644
--- a/compiler-rt/test/asan/TestCases/use-after-free-symbolizer-markup.cpp
+++ b/compiler-rt/test/asan/TestCases/use-after-free-symbolizer-markup.cpp
@@ -1,5 +1,5 @@
// COM: End to end test for the sanitizer symbolizer markup. Since it uses debug info
-// COM: to do offline symbolization we only check that the current module correctly is correctly symbolized
+// COM: to do offline symbolization we only check that the current module correctly is correctly symbolized
// REQUIRES: linux
// RUN: %clangxx_asan %s -Wl,--build-id=0x12345678 -o %t.main
// RUN: mkdir -p %t/.build-id/12
@@ -9,9 +9,8 @@
#include <stdlib.h>
-[[gnu::noinline]]
-char *alloc() {
- char *x = (char*)malloc(10 * sizeof(char));
+[[gnu::noinline]] char *alloc() {
+ char *x = (char *)malloc(10 * sizeof(char));
return x;
}
int main() {
@@ -26,7 +25,7 @@ int main() {
// CHECK: {{0x.* is located 5 bytes inside of 10-byte region .0x.*,0x.*}}
// CHECK: {{freed by thread T0 here:}}
// CHECK: {{ #1 0x.* main .*use-after-free-symbolizer-markup.cpp:}}[[@LINE-9]]
-// CHECK: {{previously allocated by thread T0 here:}}
+// CHECK: {{previously allocated by thread T0 here:}}
// CHECK: {{ #1 0x.* alloc\(\) .*use-after-free-symbolizer-markup.cpp:}}[[@LINE-16]]
// CHECK: {{ #2 0x.* main .*use-after-free-symbolizer-markup.cpp:}}[[@LINE-13]]
// CHECK: Shadow byte legend (one shadow byte represents {{[0-9]+}} application bytes):
diff --git a/compiler-rt/test/tsan/simple_stack_symbolizer_markup.cpp b/compiler-rt/test/tsan/simple_stack_symbolizer_markup.cpp
index 5798986d73..a4f5e0e9d9 100644
--- a/compiler-rt/test/tsan/simple_stack_symbolizer_markup.cpp
+++ b/compiler-rt/test/tsan/simple_stack_symbolizer_markup.cpp
@@ -1,5 +1,5 @@
// REQUIRES: linux
-// RUN: %clangxx_tsan %s -Wl,--build-id=0x12345678 -O1 -o %t.main
+// RUN: %clangxx_tsan %s -Wl,--build-id=0x12345678 -O1 -o %t.main
// RUN: mkdir -p %t/.build-id/12
// RUN: cp %t.main %t/.build-id/12/345678.debug
// RUN: %env_tsan_opts=enable_symbolizer_markup=1 %deflake %run %t.main >%t/sanitizer.out
@@ -9,9 +9,7 @@
int Global;
-void __attribute__((noinline)) foo1() {
- Global = 42;
-}
+void __attribute__((noinline)) foo1() { Global = 42; }
void __attribute__((noinline)) bar1() {
volatile int tmp = 42;
``````````
</details>
https://github.com/llvm/llvm-project/pull/77702
More information about the llvm-branch-commits
mailing list