[llvm-branch-commits] [compiler-rt] [sanitizer_symbolizer] Add end to end test for symbolizer markup. (PR #77702)

2024-03-11 Thread Andres Villegas via llvm-branch-commits
=?utf-8?q?Andrés?= Villegas ,
=?utf-8?q?Andrés?= Villegas ,
=?utf-8?q?Andrés?= Villegas ,
=?utf-8?q?Andrés?= Villegas 
Message-ID:
In-Reply-To: 


https://github.com/avillega updated 
https://github.com/llvm/llvm-project/pull/77702

>From a3220262a3236115d55235e4cc34acc8202268f4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9s=20Villegas?= 
Date: Wed, 10 Jan 2024 23:56:45 +
Subject: [PATCH 1/5] Fix typo.

Created using spr 1.3.5
---
 .../test/asan/TestCases/use-after-free-symbolizer-markup.cpp| 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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 548ae57b5c3797..323de4ec7a36ed 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 is 
correctly symbolized  
 // REQUIRES: linux
 // RUN: %clangxx_asan %s -Wl,--build-id=0x12345678 -o %t.main
 // RUN: mkdir -p %t/.build-id/12

>From 29abe012394c582239b257a6a51b833b974743f1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9s=20Villegas?= 
Date: Thu, 11 Jan 2024 17:25:29 +
Subject: [PATCH 2/5] run git clang-format

Created using spr 1.3.5
---
 .../asan/TestCases/use-after-free-symbolizer-markup.cpp  | 9 -
 compiler-rt/test/tsan/simple_stack_symbolizer_markup.cpp | 6 ++
 2 files changed, 6 insertions(+), 9 deletions(-)

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 323de4ec7a36ed..8d818217eb5b63 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 is 
correctly symbolized  
+// COM: to do offline symbolization we only check that the current module 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 
 
-[[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 5798986d73839e..a4f5e0e9d9fe46 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;

>From 2f11f65aadc8411c544f60bd3af29529625bc177 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9s=20Villegas?= 
Date: Thu, 11 Jan 2024 20:21:04 +
Subject: [PATCH 3/5] Fix review comments

Created using spr 1.3.5
---
 .../use-after-free-symbolizer-markup.cpp  | 32 ++-
 .../tsan/simple_stack_symbolizer_markup.cpp   | 29 +
 2 files changed, 32 insertions(+), 29 deletions(-)

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 8d818217eb5b63..2da07892daf6c5 100644
--- a/compiler-rt/test/asan/TestCases/use-after-free-symbolizer-markup.cpp
+++ b/compiler-rt/test/asan/TestCases/use-after-free-symbolizer-markup.cp

[llvm-branch-commits] [compiler-rt] [sanitizer_symbolizer] Add end to end test for symbolizer markup. (PR #77702)

2024-03-11 Thread Andres Villegas via llvm-branch-commits
=?utf-8?q?Andrés?= Villegas ,
=?utf-8?q?Andrés?= Villegas ,
=?utf-8?q?Andrés?= Villegas ,
=?utf-8?q?Andrés?= Villegas 
Message-ID:
In-Reply-To: 


https://github.com/avillega updated 
https://github.com/llvm/llvm-project/pull/77702

>From a3220262a3236115d55235e4cc34acc8202268f4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9s=20Villegas?= 
Date: Wed, 10 Jan 2024 23:56:45 +
Subject: [PATCH 1/5] Fix typo.

Created using spr 1.3.5
---
 .../test/asan/TestCases/use-after-free-symbolizer-markup.cpp| 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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 548ae57b5c3797..323de4ec7a36ed 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 is 
correctly symbolized  
 // REQUIRES: linux
 // RUN: %clangxx_asan %s -Wl,--build-id=0x12345678 -o %t.main
 // RUN: mkdir -p %t/.build-id/12

>From 29abe012394c582239b257a6a51b833b974743f1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9s=20Villegas?= 
Date: Thu, 11 Jan 2024 17:25:29 +
Subject: [PATCH 2/5] run git clang-format

Created using spr 1.3.5
---
 .../asan/TestCases/use-after-free-symbolizer-markup.cpp  | 9 -
 compiler-rt/test/tsan/simple_stack_symbolizer_markup.cpp | 6 ++
 2 files changed, 6 insertions(+), 9 deletions(-)

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 323de4ec7a36ed..8d818217eb5b63 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 is 
correctly symbolized  
+// COM: to do offline symbolization we only check that the current module 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 
 
-[[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 5798986d73839e..a4f5e0e9d9fe46 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;

>From 2f11f65aadc8411c544f60bd3af29529625bc177 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9s=20Villegas?= 
Date: Thu, 11 Jan 2024 20:21:04 +
Subject: [PATCH 3/5] Fix review comments

Created using spr 1.3.5
---
 .../use-after-free-symbolizer-markup.cpp  | 32 ++-
 .../tsan/simple_stack_symbolizer_markup.cpp   | 29 +
 2 files changed, 32 insertions(+), 29 deletions(-)

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 8d818217eb5b63..2da07892daf6c5 100644
--- a/compiler-rt/test/asan/TestCases/use-after-free-symbolizer-markup.cpp
+++ b/compiler-rt/test/asan/TestCases/use-after-free-symbolizer-markup.cp

[llvm-branch-commits] [compiler-rt] [sanitizer_symbolizer] Add end to end test for symbolizer markup. (PR #77702)

2024-03-11 Thread Andres Villegas via llvm-branch-commits
=?utf-8?q?Andrés?= Villegas ,
=?utf-8?q?Andrés?= Villegas ,
=?utf-8?q?Andrés?= Villegas ,
=?utf-8?q?Andrés?= Villegas 
Message-ID:
In-Reply-To: 


https://github.com/avillega closed 
https://github.com/llvm/llvm-project/pull/77702
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [GSYM][DWARF] Include end_sequence debug_line rows when looking up addr ranges (PR #89703)

2024-04-22 Thread Andres Villegas via llvm-branch-commits

https://github.com/avillega created 
https://github.com/llvm/llvm-project/pull/89703

Work around for https://github.com/llvm/llvm-project/issues/46494.
Before this change end_sequence rows in debug_line were not included
in `DWARFDebugLine::LineTable::lookupAddressRangeImpl`, this was problematic
for users of this API that needed to handle edge cases like icf optimization.



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [GSYM][DWARF] Include end_sequence debug_line rows when looking up addr ranges (PR #89703)

2024-04-23 Thread Andres Villegas via llvm-branch-commits

avillega wrote:

I was trying to figure out why llvm-dwarfdump does not seem to be affected by 
my change, there are note failing tests and I don't see any changes by doing 
some manual testing of some simple test cases. It seems that `llvm-dwarfdump` 
does not use the API I changed, for `--debug_lines` they use 
`DWARFDebugLine::SectionParser::parseNext` instead. However, it does affect 
`llvm-rdtyld` as exposed by the checks. I could ignore the `end_sequence` row 
when they are at the last position of the rows vector, for the users of 
`DWARFDebugLine::LineTable::lookupAddressRange`. Please let me know what do you 
think. Either way I will split the PR into dwarf api changes and gsym changes. 

https://github.com/llvm/llvm-project/pull/89703
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [GSYM][DWARF] Include end_sequence debug_line rows when looking up addr ranges (PR #89703)

2024-04-29 Thread Andres Villegas via llvm-branch-commits

https://github.com/avillega updated 
https://github.com/llvm/llvm-project/pull/89703


___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [GSYM][DWARF] Include end_sequence debug_line rows when looking up addr ranges (PR #89703)

2024-04-29 Thread Andres Villegas via llvm-branch-commits

https://github.com/avillega updated 
https://github.com/llvm/llvm-project/pull/89703


___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [GSYM] Include end_sequence debug_line rows in Dwarf transform (PR #90535)

2024-04-29 Thread Andres Villegas via llvm-branch-commits

https://github.com/avillega created 
https://github.com/llvm/llvm-project/pull/90535

Work around for #46494.
This change adds debug_line end_sequence rows when converting
the function line tables. By including the end_sequence
it is possible to handle some edge cases like icf optimizations.



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [GSYM] Include end_sequence debug_line rows in Dwarf transform (PR #90535)

2024-04-29 Thread Andres Villegas via llvm-branch-commits

avillega wrote:

I think I can accomplish the same behaviour exposed in 
https://github.com/llvm/llvm-project/pull/89703 which requires a change to the 
DWARF apis without actually changing them. 


https://github.com/llvm/llvm-project/pull/90535
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [compiler-rt] [sanitizer_symbolizer] Add MarkupStackTracePrinter (PR #73040)

2023-11-21 Thread Andres Villegas via llvm-branch-commits

https://github.com/avillega created 
https://github.com/llvm/llvm-project/pull/73040

This PR is part of a stack, #73029 should be merged
and reviewed first. Please only review the last commit
of this PR.

Adds a new Implementation of StackTracePrinter that only
emits symbolizer markup. Currently this change only
affects Fuchsia OS. Should be NFC.



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [compiler-rt] [sanitizer_symbolizer] Add MarkupStackTracePrinter (PR #73040)

2023-11-21 Thread Andres Villegas via llvm-branch-commits

https://github.com/avillega closed 
https://github.com/llvm/llvm-project/pull/73040
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [compiler-rt] [sanitizer_symbolizer] Add MarkupStackTracePrinter (PR #73040)

2023-11-21 Thread Andres Villegas via llvm-branch-commits

avillega wrote:

Was trying out spr

https://github.com/llvm/llvm-project/pull/73040
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [compiler-rt] [sanitizer_symbolizer] Add initial symbolizer markup support for linux. (PR #73193)

2023-11-22 Thread Andres Villegas via llvm-branch-commits

https://github.com/avillega created 
https://github.com/llvm/llvm-project/pull/73193

This is part of a stack of PRs to add support for symbolizer
markup in linux.

You can check the symbolizer markup specification at:
https://llvm.org/docs/SymbolizerMarkupFormat.html



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [compiler-rt] [sanitizer_symbolizer] RenderContextual elements for symbolizer markup. (PR #73194)

2023-11-22 Thread Andres Villegas via llvm-branch-commits

https://github.com/avillega created 
https://github.com/llvm/llvm-project/pull/73194

This is part of a stack of PRs to add support for symbolizer
markup in linux.

Render contextual symbolizer markup elements. For Fuchsia it is not
neccesarry to emit any context given that Fuchsia's logging
infrastructure already handles emiting it when neccesary.

For more information about contextual symbolizer markup elements:
https://llvm.org/docs/SymbolizerMarkupFormat.html#contextual-elements



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [compiler-rt] [sanitizer_common tests] Add tests for sanitizer symbolzier markup. (PR #73195)

2023-11-22 Thread Andres Villegas via llvm-branch-commits

https://github.com/avillega created 
https://github.com/llvm/llvm-project/pull/73195

This is part of a stack of PRs to add support for symbolizer
markup in linux.

Add __sanitizer_print_stack_trace test for sanitizer symbolizer markup.



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [compiler-rt] [sanitizer_symbolizer] Add initial symbolizer markup support for linux. (PR #73193)

2023-11-27 Thread Andres Villegas via llvm-branch-commits

avillega wrote:

> LGTM. but looks like it can be squashed with sanitizer_common test

The tests also test Emitting contextual elements, so I will squash the tests 
with the RenderContextual elements PR.

https://github.com/llvm/llvm-project/pull/73193
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang-tools-extra] [clang] [flang] [llvm] [libc] [compiler-rt] [sanitizer_symbolizer] Add initial symbolizer markup support for linux. (PR #73193)

2023-11-27 Thread Andres Villegas via llvm-branch-commits

https://github.com/avillega updated 
https://github.com/llvm/llvm-project/pull/73193


___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] [libc] [compiler-rt] [clang] [clang-tools-extra] [flang] [sanitizer_symbolizer] Add initial symbolizer markup support for linux. (PR #73193)

2023-11-27 Thread Andres Villegas via llvm-branch-commits

https://github.com/avillega updated 
https://github.com/llvm/llvm-project/pull/73193


___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [mlir] [llvm] [clang-tools-extra] [clang] [libc] [compiler-rt] [flang] [sanitizer_symbolizer] Add initial symbolizer markup support for linux. (PR #73193)

2023-11-27 Thread Andres Villegas via llvm-branch-commits

https://github.com/avillega updated 
https://github.com/llvm/llvm-project/pull/73193


___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang-tools-extra] [llvm] [compiler-rt] [libc] [mlir] [flang] [clang] [sanitizer_symbolizer] Add initial symbolizer markup support for linux. (PR #73193)

2023-11-27 Thread Andres Villegas via llvm-branch-commits

https://github.com/avillega updated 
https://github.com/llvm/llvm-project/pull/73193


___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] [clang-tools-extra] [clang] [libc] [compiler-rt] [flang] [sanitizer_symbolizer] RenderContextual elements for symbolizer markup. (PR #73194)

2023-11-27 Thread Andres Villegas via llvm-branch-commits

https://github.com/avillega updated 
https://github.com/llvm/llvm-project/pull/73194


___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] [clang-tools-extra] [llvm] [libc] [compiler-rt] [flang] [sanitizer_symbolizer] RenderContextual elements for symbolizer markup. (PR #73194)

2023-11-27 Thread Andres Villegas via llvm-branch-commits

https://github.com/avillega updated 
https://github.com/llvm/llvm-project/pull/73194


___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang-tools-extra] [llvm] [compiler-rt] [libc] [flang] [clang] [sanitizer_common tests] Add tests for sanitizer symbolzier markup. (PR #73195)

2023-11-27 Thread Andres Villegas via llvm-branch-commits

https://github.com/avillega updated 
https://github.com/llvm/llvm-project/pull/73195


___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] [flang] [compiler-rt] [clang-tools-extra] [clang] [libc] [sanitizer_common tests] Add tests for sanitizer symbolzier markup. (PR #73195)

2023-11-27 Thread Andres Villegas via llvm-branch-commits

https://github.com/avillega updated 
https://github.com/llvm/llvm-project/pull/73195


___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] [llvm] [libc] [compiler-rt] [mlir] [flang] [libcxx] [clang-tools-extra] [sanitizer_symbolizer] RenderContextual elements for symbolizer markup. (PR #73194)

2023-11-27 Thread Andres Villegas via llvm-branch-commits

https://github.com/avillega updated 
https://github.com/llvm/llvm-project/pull/73194


___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] [libcxx] [clang-tools-extra] [llvm] [libc] [compiler-rt] [mlir] [flang] [sanitizer_symbolizer] RenderContextual elements for symbolizer markup. (PR #73194)

2023-11-27 Thread Andres Villegas via llvm-branch-commits

https://github.com/avillega updated 
https://github.com/llvm/llvm-project/pull/73194


___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] [llvm] [libc] [compiler-rt] [mlir] [flang] [libcxx] [clang-tools-extra] [sanitizer_common tests] Add tests for sanitizer symbolzier markup. (PR #73195)

2023-11-27 Thread Andres Villegas via llvm-branch-commits

https://github.com/avillega updated 
https://github.com/llvm/llvm-project/pull/73195


___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] [mlir] [libcxx] [flang] [clang-tools-extra] [llvm] [libc] [compiler-rt] [sanitizer_common tests] Add tests for sanitizer symbolzier markup. (PR #73195)

2023-11-27 Thread Andres Villegas via llvm-branch-commits

https://github.com/avillega updated 
https://github.com/llvm/llvm-project/pull/73195


___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [compiler-rt] [mlir] [libc] [clang] [llvm] [clang-tools-extra] [flang] [libcxx] [sanitizer_common tests] Add tests for sanitizer symbolzier markup. (PR #73195)

2023-11-28 Thread Andres Villegas via llvm-branch-commits

https://github.com/avillega closed 
https://github.com/llvm/llvm-project/pull/73195
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang-tools-extra] [libcxx] [clang] [mlir] [compiler-rt] [llvm] [flang] [libc] [sanitizer_common tests] Add tests for sanitizer symbolzier markup. (PR #73195)

2023-11-28 Thread Andres Villegas via llvm-branch-commits

avillega wrote:

I've squashed this test into the change that introduces the Rendering of 
Contextual elements #73194

https://github.com/llvm/llvm-project/pull/73195
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [libc] [flang] [compiler-rt] [clang] [llvm] [clang-tools-extra] [OptTable] Make new lines in help text respect indentation (PR #74880)

2023-12-08 Thread Andres Villegas via llvm-branch-commits

https://github.com/avillega created 
https://github.com/llvm/llvm-project/pull/74880

With this changes, new lines in the HelpText defined
in OptTable have the same indentation as the first line.

Before, the help output will look something like:

```
--color=   Whether to use color when
symbolizing log markup: always, auto, never
```

With this change:

```
--color=   - Whether to use color when
symbolizing log markup: always, auto, never
```

Note the "-" at the beginning of the help text in the new version,
it was added to clearly separate the HelpText of the different
options.



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [compiler-rt] [flang] [clang-tools-extra] [llvm] [clang] [libc] [OptTable] Make new lines in help text respect indentation (PR #74880)

2023-12-11 Thread Andres Villegas via llvm-branch-commits

avillega wrote:

> Is the main functionality of this test actually tested in the current patch? 
> It doesn't seem to be to me.

I don't fully understand your comment, I am working on getting some of the test 
to be whitespace strict to specifically test the functionality. 

https://github.com/llvm/llvm-project/pull/74880
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] [clang-tools-extra] [flang] [libc] [compiler-rt] [clang] [OptTable] Make new lines in help text respect indentation (PR #74880)

2023-12-11 Thread Andres Villegas via llvm-branch-commits

https://github.com/avillega updated 
https://github.com/llvm/llvm-project/pull/74880


___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang-tools-extra] [flang] [clang] [llvm] [compiler-rt] [libc] [OptTable] Make new lines in help text respect indentation (PR #74880)

2023-12-11 Thread Andres Villegas via llvm-branch-commits

https://github.com/avillega updated 
https://github.com/llvm/llvm-project/pull/74880


___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [flang] [libc] [compiler-rt] [llvm] [clang-tools-extra] [clang] [OptTable] Make new lines in help text respect indentation (PR #74880)

2023-12-11 Thread Andres Villegas via llvm-branch-commits

https://github.com/avillega updated 
https://github.com/llvm/llvm-project/pull/74880

>From 61fd524086abe13b6ed0a792a0e5ed29ba8fc692 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9s=20Villegas?= 
Date: Tue, 12 Dec 2023 00:10:48 +
Subject: [PATCH] Fix flang help tests.

Created using spr 1.3.4
---
 flang/test/Driver/driver-help-hidden.f90 | 226 ++--
 flang/test/Driver/driver-help.f90| 434 +++
 2 files changed, 330 insertions(+), 330 deletions(-)

diff --git a/flang/test/Driver/driver-help-hidden.f90 
b/flang/test/Driver/driver-help-hidden.f90
index 9a11a7a571ffc..ca114320d13d7 100644
--- a/flang/test/Driver/driver-help-hidden.f90
+++ b/flang/test/Driver/driver-help-hidden.f90
@@ -14,143 +14,143 @@
 ! CHECK:USAGE: flang-new
 ! CHECK-EMPTY:
 ! CHECK-NEXT: DRIVER OPTIONS:
-! CHECK-NEXT:  --driver-mode= Set the driver mode to either 'gcc', 
'g++', 'cpp', 'cl' or 'flang'
+! CHECK-NEXT:  --driver-mode= - Set the driver mode to either 'gcc', 
'g++', 'cpp', 'cl' or 'flang'
 ! CHECK-EMPTY:
 ! CHECK-NEXT:OPTIONS:
-! CHECK-NEXT: -###Print (but do not run) the commands to 
run for this compilation
-! CHECK-NEXT: -ccc-print-phases   Dump list of actions to perform
-! CHECK-NEXT: -cppEnable predefined and command line 
preprocessor macros
-! CHECK-NEXT: -c  Only run preprocess, compile, and 
assemble steps
-! CHECK-NEXT: -dumpmachineDisplay the compiler's target processor
-! CHECK-NEXT: -dumpversionDisplay the version of the compiler
-! CHECK-NEXT: -D =  Define  to  (or 1 if 
 omitted)
-! CHECK-NEXT: -emit-llvm  Use the LLVM representation for 
assembler and object files
-! CHECK-NEXT: -E  Only run the preprocessor
+! CHECK-NEXT: -###- Print (but do not run) the commands to 
run for this compilation
+! CHECK-NEXT: -ccc-print-phases   - Dump list of actions to perform
+! CHECK-NEXT: -cpp- Enable predefined and command line 
preprocessor macros
+! CHECK-NEXT: -c  - Only run preprocess, compile, and 
assemble steps
+! CHECK-NEXT: -dumpmachine- Display the compiler's target processor
+! CHECK-NEXT: -dumpversion- Display the version of the compiler
+! CHECK-NEXT: -D =  - Define  to  (or 1 if 
 omitted)
+! CHECK-NEXT: -emit-llvm  - Use the LLVM representation for 
assembler and object files
+! CHECK-NEXT: -E  - Only run the preprocessor
 ! CHECK-NEXT: -falternative-parameter-statement
-! CHECK-NEXT: Enable the old style PARAMETER statement
-! CHECK-NEXT: -fapprox-func   Allow certain math function calls to be 
replaced with an approximately equivalent calculation
-! CHECK-NEXT: -fbackslash Specify that backslash in string 
introduces an escape character
-! CHECK-NEXT: -fcolor-diagnostics Enable colors in diagnostics
-! CHECK-NEXT: -fconvert=   Set endian conversion of data for 
unformatted files
-! CHECK-NEXT: -fdefault-double-8  Set the default double precision kind to 
an 8 byte wide type
-! CHECK-NEXT: -fdefault-integer-8 Set the default integer and logical kind 
to an 8 byte wide type
-! CHECK-NEXT: -fdefault-real-8Set the default real kind to an 8 byte 
wide type
-! CHECK-NEXT: -ffast-math Allow aggressive, lossy floating-point 
optimizations
-! CHECK-NEXT: -ffixed-formProcess source files in fixed form
+! CHECK-NEXT: - Enable the old style PARAMETER 
statement
+! CHECK-NEXT: -fapprox-func   - Allow certain math function calls to 
be replaced with an approximately equivalent calculation
+! CHECK-NEXT: -fbackslash - Specify that backslash in string 
introduces an escape character
+! CHECK-NEXT: -fcolor-diagnostics - Enable colors in diagnostics
+! CHECK-NEXT: -fconvert=   - Set endian conversion of data for 
unformatted files
+! CHECK-NEXT: -fdefault-double-8  - Set the default double precision kind 
to an 8 byte wide type
+! CHECK-NEXT: -fdefault-integer-8 - Set the default integer and logical 
kind to an 8 byte wide type
+! CHECK-NEXT: -fdefault-real-8- Set the default real kind to an 8 byte 
wide type
+! CHECK-NEXT: -ffast-math - Allow aggressive, lossy floating-point 
optimizations
+! CHECK-NEXT: -ffixed-form- Process source files in fixed form
 ! CHECK-NEXT: -ffixed-line-length=
-! CHECK-NEXT: Use  as character line width in 
fixed mode
-! CHECK-NEXT: -ffp-contract=   Form fused FP ops (e.g. FMAs)
-! CHECK-NEXT: -ffree-form Process source files in free form
-! CHECK-NEXT: -fhonor-infinities  Specify that floating-point 
optimizations are not allowed that assume arguments and results are not +-inf.
-! CHECK-NEXT: -fhonor-nansSpecify that floating-point 
optimizations are not allowed that assume argum

[llvm-branch-commits] [flang] [libc] [clang-tools-extra] [compiler-rt] [clang] [llvm] [OptTable] Make new lines in help text respect indentation (PR #74880)

2023-12-12 Thread Andres Villegas via llvm-branch-commits


@@ -1,16 +1,16 @@
 ; RUN: llvm-cvtres /h > %t
-; RUN: FileCheck -input-file=%t %s -check-prefix=HELP_TEST
+; RUN: FileCheck -input-file=%t %s --strict-whitespace -check-prefix=HELP_TEST
 
-; HELP_TEST: OVERVIEW: Resource Converter
-; HELP_TEST-DAG:  USAGE: llvm-cvtres [options] file...
-; HELP_TEST-DAG:  OPTIONS:
-; HELP_TEST-NEXT:   /{{DEFINE}}:symbol - Not implemented
-; HELP_TEST-NEXT:   /FOLDDUPS: - Not implemented
-; HELP_TEST-NEXT:   /HELP - Display available options
+;  HELP_TEST: OVERVIEW: Resource Converter
+;  HELP_TEST-DAG: USAGE: llvm-cvtres [options] file...
+;  HELP_TEST-DAG: OPTIONS:
+; HELP_TEST-NEXT:   /{{DEFINE}}:symbol - Not implemented

avillega wrote:

This is a quirk of FileCheck. It thinks that `DEFINE` is a directive, so in 
order to match the `DEFINE` word it is necessary to make it a regex. FileCheck 
will ignore `{{}}` and that is why it doesn't look at the same indentation 
level as the rest of the options, but it is. 

https://github.com/llvm/llvm-project/pull/74880
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [flang] [llvm] [compiler-rt] [clang] [libc] [clang-tools-extra] [OptTable] Make new lines in help text respect indentation (PR #74880)

2023-12-12 Thread Andres Villegas via llvm-branch-commits

https://github.com/avillega edited 
https://github.com/llvm/llvm-project/pull/74880
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] [compiler-rt] [clang] [libc] [flang] [clang-tools-extra] [OptTable] Make new lines in help text respect indentation (PR #74880)

2023-12-12 Thread Andres Villegas via llvm-branch-commits

avillega wrote:

> > Note the "-" at the beginning of the help text in the new version,
> > it was added to clearly separate the HelpText of the different
> > options.
> 
> > Taking a step back, I'm not sure the addition of the dash has anything to 
> > do with the main purpose of this PR, and I'm a little worried people will 
> > not spot that this PR is adding it. I personally have no issue with that 
> > part of the change, but I wonder if others wouldn't want it?
> 
> I think `-` in `--help` messages is (very) uncommon. Many programs (`cat, 
> node, gcc, as, 7z, ...`) don't use `-`.

I will remove it. But I added it for two reasons:
- I wanted a way to clearly spot the beginning of the help text of an option 
given that new lines will be indented at the same level as the first line of 
the help text, it is more difficult to clearly see the start and end of the 
help text for an specific option.
- The help text generated by llvm::cl uses the `- ` to separate the help text 
of each option so I was trying to do something similar to what many llvm tools 
still do.

 

https://github.com/llvm/llvm-project/pull/74880
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] [compiler-rt] [lldb] [clang] [lld] [libc] [libcxx] [flang] [clang-tools-extra] [OptTable] Make new lines in help text respect indentation (PR #74880)

2023-12-12 Thread Andres Villegas via llvm-branch-commits

https://github.com/avillega updated 
https://github.com/llvm/llvm-project/pull/74880

>From 61fd524086abe13b6ed0a792a0e5ed29ba8fc692 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9s=20Villegas?= 
Date: Tue, 12 Dec 2023 00:10:48 +
Subject: [PATCH] Fix flang help tests.

Created using spr 1.3.4
---
 flang/test/Driver/driver-help-hidden.f90 | 226 ++--
 flang/test/Driver/driver-help.f90| 434 +++
 2 files changed, 330 insertions(+), 330 deletions(-)

diff --git a/flang/test/Driver/driver-help-hidden.f90 
b/flang/test/Driver/driver-help-hidden.f90
index 9a11a7a571ffcc..ca114320d13d72 100644
--- a/flang/test/Driver/driver-help-hidden.f90
+++ b/flang/test/Driver/driver-help-hidden.f90
@@ -14,143 +14,143 @@
 ! CHECK:USAGE: flang-new
 ! CHECK-EMPTY:
 ! CHECK-NEXT: DRIVER OPTIONS:
-! CHECK-NEXT:  --driver-mode= Set the driver mode to either 'gcc', 
'g++', 'cpp', 'cl' or 'flang'
+! CHECK-NEXT:  --driver-mode= - Set the driver mode to either 'gcc', 
'g++', 'cpp', 'cl' or 'flang'
 ! CHECK-EMPTY:
 ! CHECK-NEXT:OPTIONS:
-! CHECK-NEXT: -###Print (but do not run) the commands to 
run for this compilation
-! CHECK-NEXT: -ccc-print-phases   Dump list of actions to perform
-! CHECK-NEXT: -cppEnable predefined and command line 
preprocessor macros
-! CHECK-NEXT: -c  Only run preprocess, compile, and 
assemble steps
-! CHECK-NEXT: -dumpmachineDisplay the compiler's target processor
-! CHECK-NEXT: -dumpversionDisplay the version of the compiler
-! CHECK-NEXT: -D =  Define  to  (or 1 if 
 omitted)
-! CHECK-NEXT: -emit-llvm  Use the LLVM representation for 
assembler and object files
-! CHECK-NEXT: -E  Only run the preprocessor
+! CHECK-NEXT: -###- Print (but do not run) the commands to 
run for this compilation
+! CHECK-NEXT: -ccc-print-phases   - Dump list of actions to perform
+! CHECK-NEXT: -cpp- Enable predefined and command line 
preprocessor macros
+! CHECK-NEXT: -c  - Only run preprocess, compile, and 
assemble steps
+! CHECK-NEXT: -dumpmachine- Display the compiler's target processor
+! CHECK-NEXT: -dumpversion- Display the version of the compiler
+! CHECK-NEXT: -D =  - Define  to  (or 1 if 
 omitted)
+! CHECK-NEXT: -emit-llvm  - Use the LLVM representation for 
assembler and object files
+! CHECK-NEXT: -E  - Only run the preprocessor
 ! CHECK-NEXT: -falternative-parameter-statement
-! CHECK-NEXT: Enable the old style PARAMETER statement
-! CHECK-NEXT: -fapprox-func   Allow certain math function calls to be 
replaced with an approximately equivalent calculation
-! CHECK-NEXT: -fbackslash Specify that backslash in string 
introduces an escape character
-! CHECK-NEXT: -fcolor-diagnostics Enable colors in diagnostics
-! CHECK-NEXT: -fconvert=   Set endian conversion of data for 
unformatted files
-! CHECK-NEXT: -fdefault-double-8  Set the default double precision kind to 
an 8 byte wide type
-! CHECK-NEXT: -fdefault-integer-8 Set the default integer and logical kind 
to an 8 byte wide type
-! CHECK-NEXT: -fdefault-real-8Set the default real kind to an 8 byte 
wide type
-! CHECK-NEXT: -ffast-math Allow aggressive, lossy floating-point 
optimizations
-! CHECK-NEXT: -ffixed-formProcess source files in fixed form
+! CHECK-NEXT: - Enable the old style PARAMETER 
statement
+! CHECK-NEXT: -fapprox-func   - Allow certain math function calls to 
be replaced with an approximately equivalent calculation
+! CHECK-NEXT: -fbackslash - Specify that backslash in string 
introduces an escape character
+! CHECK-NEXT: -fcolor-diagnostics - Enable colors in diagnostics
+! CHECK-NEXT: -fconvert=   - Set endian conversion of data for 
unformatted files
+! CHECK-NEXT: -fdefault-double-8  - Set the default double precision kind 
to an 8 byte wide type
+! CHECK-NEXT: -fdefault-integer-8 - Set the default integer and logical 
kind to an 8 byte wide type
+! CHECK-NEXT: -fdefault-real-8- Set the default real kind to an 8 byte 
wide type
+! CHECK-NEXT: -ffast-math - Allow aggressive, lossy floating-point 
optimizations
+! CHECK-NEXT: -ffixed-form- Process source files in fixed form
 ! CHECK-NEXT: -ffixed-line-length=
-! CHECK-NEXT: Use  as character line width in 
fixed mode
-! CHECK-NEXT: -ffp-contract=   Form fused FP ops (e.g. FMAs)
-! CHECK-NEXT: -ffree-form Process source files in free form
-! CHECK-NEXT: -fhonor-infinities  Specify that floating-point 
optimizations are not allowed that assume arguments and results are not +-inf.
-! CHECK-NEXT: -fhonor-nansSpecify that floating-point 
optimizations are not allowed that assume arg

[llvm-branch-commits] [clang-tools-extra] [clang] [lld] [lldb] [llvm] [compiler-rt] [libc] [libcxx] [flang] [OptTable] Make new lines in help text respect indentation (PR #74880)

2023-12-12 Thread Andres Villegas via llvm-branch-commits

https://github.com/avillega updated 
https://github.com/llvm/llvm-project/pull/74880

>From 61fd524086abe13b6ed0a792a0e5ed29ba8fc692 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9s=20Villegas?= 
Date: Tue, 12 Dec 2023 00:10:48 +
Subject: [PATCH] Fix flang help tests.

Created using spr 1.3.4
---
 flang/test/Driver/driver-help-hidden.f90 | 226 ++--
 flang/test/Driver/driver-help.f90| 434 +++
 2 files changed, 330 insertions(+), 330 deletions(-)

diff --git a/flang/test/Driver/driver-help-hidden.f90 
b/flang/test/Driver/driver-help-hidden.f90
index 9a11a7a571ffcc..ca114320d13d72 100644
--- a/flang/test/Driver/driver-help-hidden.f90
+++ b/flang/test/Driver/driver-help-hidden.f90
@@ -14,143 +14,143 @@
 ! CHECK:USAGE: flang-new
 ! CHECK-EMPTY:
 ! CHECK-NEXT: DRIVER OPTIONS:
-! CHECK-NEXT:  --driver-mode= Set the driver mode to either 'gcc', 
'g++', 'cpp', 'cl' or 'flang'
+! CHECK-NEXT:  --driver-mode= - Set the driver mode to either 'gcc', 
'g++', 'cpp', 'cl' or 'flang'
 ! CHECK-EMPTY:
 ! CHECK-NEXT:OPTIONS:
-! CHECK-NEXT: -###Print (but do not run) the commands to 
run for this compilation
-! CHECK-NEXT: -ccc-print-phases   Dump list of actions to perform
-! CHECK-NEXT: -cppEnable predefined and command line 
preprocessor macros
-! CHECK-NEXT: -c  Only run preprocess, compile, and 
assemble steps
-! CHECK-NEXT: -dumpmachineDisplay the compiler's target processor
-! CHECK-NEXT: -dumpversionDisplay the version of the compiler
-! CHECK-NEXT: -D =  Define  to  (or 1 if 
 omitted)
-! CHECK-NEXT: -emit-llvm  Use the LLVM representation for 
assembler and object files
-! CHECK-NEXT: -E  Only run the preprocessor
+! CHECK-NEXT: -###- Print (but do not run) the commands to 
run for this compilation
+! CHECK-NEXT: -ccc-print-phases   - Dump list of actions to perform
+! CHECK-NEXT: -cpp- Enable predefined and command line 
preprocessor macros
+! CHECK-NEXT: -c  - Only run preprocess, compile, and 
assemble steps
+! CHECK-NEXT: -dumpmachine- Display the compiler's target processor
+! CHECK-NEXT: -dumpversion- Display the version of the compiler
+! CHECK-NEXT: -D =  - Define  to  (or 1 if 
 omitted)
+! CHECK-NEXT: -emit-llvm  - Use the LLVM representation for 
assembler and object files
+! CHECK-NEXT: -E  - Only run the preprocessor
 ! CHECK-NEXT: -falternative-parameter-statement
-! CHECK-NEXT: Enable the old style PARAMETER statement
-! CHECK-NEXT: -fapprox-func   Allow certain math function calls to be 
replaced with an approximately equivalent calculation
-! CHECK-NEXT: -fbackslash Specify that backslash in string 
introduces an escape character
-! CHECK-NEXT: -fcolor-diagnostics Enable colors in diagnostics
-! CHECK-NEXT: -fconvert=   Set endian conversion of data for 
unformatted files
-! CHECK-NEXT: -fdefault-double-8  Set the default double precision kind to 
an 8 byte wide type
-! CHECK-NEXT: -fdefault-integer-8 Set the default integer and logical kind 
to an 8 byte wide type
-! CHECK-NEXT: -fdefault-real-8Set the default real kind to an 8 byte 
wide type
-! CHECK-NEXT: -ffast-math Allow aggressive, lossy floating-point 
optimizations
-! CHECK-NEXT: -ffixed-formProcess source files in fixed form
+! CHECK-NEXT: - Enable the old style PARAMETER 
statement
+! CHECK-NEXT: -fapprox-func   - Allow certain math function calls to 
be replaced with an approximately equivalent calculation
+! CHECK-NEXT: -fbackslash - Specify that backslash in string 
introduces an escape character
+! CHECK-NEXT: -fcolor-diagnostics - Enable colors in diagnostics
+! CHECK-NEXT: -fconvert=   - Set endian conversion of data for 
unformatted files
+! CHECK-NEXT: -fdefault-double-8  - Set the default double precision kind 
to an 8 byte wide type
+! CHECK-NEXT: -fdefault-integer-8 - Set the default integer and logical 
kind to an 8 byte wide type
+! CHECK-NEXT: -fdefault-real-8- Set the default real kind to an 8 byte 
wide type
+! CHECK-NEXT: -ffast-math - Allow aggressive, lossy floating-point 
optimizations
+! CHECK-NEXT: -ffixed-form- Process source files in fixed form
 ! CHECK-NEXT: -ffixed-line-length=
-! CHECK-NEXT: Use  as character line width in 
fixed mode
-! CHECK-NEXT: -ffp-contract=   Form fused FP ops (e.g. FMAs)
-! CHECK-NEXT: -ffree-form Process source files in free form
-! CHECK-NEXT: -fhonor-infinities  Specify that floating-point 
optimizations are not allowed that assume arguments and results are not +-inf.
-! CHECK-NEXT: -fhonor-nansSpecify that floating-point 
optimizations are not allowed that assume arg

[llvm-branch-commits] [llvm] [compiler-rt] [lldb] [clang] [lld] [libc] [libcxx] [flang] [clang-tools-extra] [OptTable] Make new lines in help text respect indentation (PR #74880)

2023-12-12 Thread Andres Villegas via llvm-branch-commits

https://github.com/avillega edited 
https://github.com/llvm/llvm-project/pull/74880
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang-tools-extra] [clang] [llvm] [Clangd] Refactor Check to have more explicit cli args. (PR #75867)

2023-12-18 Thread Andres Villegas via llvm-branch-commits

https://github.com/avillega created 
https://github.com/llvm/llvm-project/pull/75867

Move the definition of the Check* command line options into the
ClangdMain file, to make them more explicit.

This is in preparation of moving Clangd to use OptTable to parse
its commnad line options.



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang-tools-extra] [clang] [llvm] [Clangd] Refactor Check to have more explicit cli args. (PR #75867)

2023-12-18 Thread Andres Villegas via llvm-branch-commits

https://github.com/avillega updated 
https://github.com/llvm/llvm-project/pull/75867

>From e31560e8462108869f80b39dfd186efcf45a77f2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9s=20Villegas?= 
Date: Mon, 18 Dec 2023 22:56:01 +
Subject: [PATCH] Run git clang-format

Created using spr 1.3.5
---
 clang-tools-extra/clangd/tool/Check.cpp  | 6 +++---
 clang-tools-extra/clangd/tool/ClangdMain.cpp | 5 ++---
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/clang-tools-extra/clangd/tool/Check.cpp 
b/clang-tools-extra/clangd/tool/Check.cpp
index 7c04a2f16e5a30..5e9d8d53625b68 100644
--- a/clang-tools-extra/clangd/tool/Check.cpp
+++ b/clang-tools-extra/clangd/tool/Check.cpp
@@ -133,7 +133,8 @@ class Checker {
   // Number of non-fatal errors seen.
   unsigned ErrCount = 0;
 
-  Checker(llvm::StringRef File, const ClangdLSPServer::Options &Opts, const 
ClangdCheckOptions &CheckOpts)
+  Checker(llvm::StringRef File, const ClangdLSPServer::Options &Opts,
+  const ClangdCheckOptions &CheckOpts)
   : File(File), Opts(Opts), CheckOpts(CheckOpts) {}
 
   // Read compilation database and choose a compile command for the file.
@@ -473,8 +474,7 @@ bool check(llvm::StringRef File, const ThreadsafeFS &TFS,
 }
 
   public:
-OverrideConfigProvider(bool CheckTidyTime)
-: CheckTidyTime(CheckTidyTime) {}
+OverrideConfigProvider(bool CheckTidyTime) : CheckTidyTime(CheckTidyTime) 
{}
 
   } OverrideConfig{CheckOpts.CheckTidyTime.has_value()};
 
diff --git a/clang-tools-extra/clangd/tool/ClangdMain.cpp 
b/clang-tools-extra/clangd/tool/ClangdMain.cpp
index 34a227b2dbb286..3b08e023236dc1 100644
--- a/clang-tools-extra/clangd/tool/ClangdMain.cpp
+++ b/clang-tools-extra/clangd/tool/ClangdMain.cpp
@@ -573,8 +573,7 @@ llvm::cl::opt CheckCompletion{
 llvm::cl::desc("Run code-completion at each point (slow)"),
 llvm::cl::init(false)};
 llvm::cl::opt CheckWarnings{
-"check-warnings",
-llvm::cl::desc("Print warnings as well as errors"),
+"check-warnings", llvm::cl::desc("Print warnings as well as errors"),
 llvm::cl::init(false)};
 
 /// Supports a test URI scheme with relaxed constraints for lit tests.
@@ -1002,7 +1001,7 @@ clangd accepts flags on the commandline, and in the 
CLANGD_FLAGS environment var
 
 ClangdCheckOptions CheckOpts;
 if (CheckTidyTime.getNumOccurrences())
-CheckOpts.CheckTidyTime= std::make_optional(CheckTidyTime.ValueStr);
+  CheckOpts.CheckTidyTime = std::make_optional(CheckTidyTime.ValueStr);
 
 CheckOpts.CheckFileLines = CheckFileLines;
 CheckOpts.CheckCompletion = CheckCompletion;

___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] [clang] [clang-tools-extra] [NFC, Clangd] Refactor Check to have more explicit cli args. (PR #75867)

2023-12-18 Thread Andres Villegas via llvm-branch-commits

https://github.com/avillega edited 
https://github.com/llvm/llvm-project/pull/75867
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang-tools-extra] [flang] [libc] [llvm] [clang] [compiler-rt] [NFC, Clangd] Refactor Check to have more explicit cli args. (PR #75867)

2023-12-20 Thread Andres Villegas via llvm-branch-commits

https://github.com/avillega updated 
https://github.com/llvm/llvm-project/pull/75867

>From e31560e8462108869f80b39dfd186efcf45a77f2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9s=20Villegas?= 
Date: Mon, 18 Dec 2023 22:56:01 +
Subject: [PATCH] Run git clang-format

Created using spr 1.3.5
---
 clang-tools-extra/clangd/tool/Check.cpp  | 6 +++---
 clang-tools-extra/clangd/tool/ClangdMain.cpp | 5 ++---
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/clang-tools-extra/clangd/tool/Check.cpp 
b/clang-tools-extra/clangd/tool/Check.cpp
index 7c04a2f16e5a30..5e9d8d53625b68 100644
--- a/clang-tools-extra/clangd/tool/Check.cpp
+++ b/clang-tools-extra/clangd/tool/Check.cpp
@@ -133,7 +133,8 @@ class Checker {
   // Number of non-fatal errors seen.
   unsigned ErrCount = 0;
 
-  Checker(llvm::StringRef File, const ClangdLSPServer::Options &Opts, const 
ClangdCheckOptions &CheckOpts)
+  Checker(llvm::StringRef File, const ClangdLSPServer::Options &Opts,
+  const ClangdCheckOptions &CheckOpts)
   : File(File), Opts(Opts), CheckOpts(CheckOpts) {}
 
   // Read compilation database and choose a compile command for the file.
@@ -473,8 +474,7 @@ bool check(llvm::StringRef File, const ThreadsafeFS &TFS,
 }
 
   public:
-OverrideConfigProvider(bool CheckTidyTime)
-: CheckTidyTime(CheckTidyTime) {}
+OverrideConfigProvider(bool CheckTidyTime) : CheckTidyTime(CheckTidyTime) 
{}
 
   } OverrideConfig{CheckOpts.CheckTidyTime.has_value()};
 
diff --git a/clang-tools-extra/clangd/tool/ClangdMain.cpp 
b/clang-tools-extra/clangd/tool/ClangdMain.cpp
index 34a227b2dbb286..3b08e023236dc1 100644
--- a/clang-tools-extra/clangd/tool/ClangdMain.cpp
+++ b/clang-tools-extra/clangd/tool/ClangdMain.cpp
@@ -573,8 +573,7 @@ llvm::cl::opt CheckCompletion{
 llvm::cl::desc("Run code-completion at each point (slow)"),
 llvm::cl::init(false)};
 llvm::cl::opt CheckWarnings{
-"check-warnings",
-llvm::cl::desc("Print warnings as well as errors"),
+"check-warnings", llvm::cl::desc("Print warnings as well as errors"),
 llvm::cl::init(false)};
 
 /// Supports a test URI scheme with relaxed constraints for lit tests.
@@ -1002,7 +1001,7 @@ clangd accepts flags on the commandline, and in the 
CLANGD_FLAGS environment var
 
 ClangdCheckOptions CheckOpts;
 if (CheckTidyTime.getNumOccurrences())
-CheckOpts.CheckTidyTime= std::make_optional(CheckTidyTime.ValueStr);
+  CheckOpts.CheckTidyTime = std::make_optional(CheckTidyTime.ValueStr);
 
 CheckOpts.CheckFileLines = CheckFileLines;
 CheckOpts.CheckCompletion = CheckCompletion;

___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang-tools-extra] [compiler-rt] [llvm] [clang] [libc] [flang] [NFC, Clangd] Refactor Check to have more explicit cli args. (PR #75867)

2023-12-20 Thread Andres Villegas via llvm-branch-commits

https://github.com/avillega updated 
https://github.com/llvm/llvm-project/pull/75867

>From e31560e8462108869f80b39dfd186efcf45a77f2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9s=20Villegas?= 
Date: Mon, 18 Dec 2023 22:56:01 +
Subject: [PATCH] Run git clang-format

Created using spr 1.3.5
---
 clang-tools-extra/clangd/tool/Check.cpp  | 6 +++---
 clang-tools-extra/clangd/tool/ClangdMain.cpp | 5 ++---
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/clang-tools-extra/clangd/tool/Check.cpp 
b/clang-tools-extra/clangd/tool/Check.cpp
index 7c04a2f16e5a30..5e9d8d53625b68 100644
--- a/clang-tools-extra/clangd/tool/Check.cpp
+++ b/clang-tools-extra/clangd/tool/Check.cpp
@@ -133,7 +133,8 @@ class Checker {
   // Number of non-fatal errors seen.
   unsigned ErrCount = 0;
 
-  Checker(llvm::StringRef File, const ClangdLSPServer::Options &Opts, const 
ClangdCheckOptions &CheckOpts)
+  Checker(llvm::StringRef File, const ClangdLSPServer::Options &Opts,
+  const ClangdCheckOptions &CheckOpts)
   : File(File), Opts(Opts), CheckOpts(CheckOpts) {}
 
   // Read compilation database and choose a compile command for the file.
@@ -473,8 +474,7 @@ bool check(llvm::StringRef File, const ThreadsafeFS &TFS,
 }
 
   public:
-OverrideConfigProvider(bool CheckTidyTime)
-: CheckTidyTime(CheckTidyTime) {}
+OverrideConfigProvider(bool CheckTidyTime) : CheckTidyTime(CheckTidyTime) 
{}
 
   } OverrideConfig{CheckOpts.CheckTidyTime.has_value()};
 
diff --git a/clang-tools-extra/clangd/tool/ClangdMain.cpp 
b/clang-tools-extra/clangd/tool/ClangdMain.cpp
index 34a227b2dbb286..3b08e023236dc1 100644
--- a/clang-tools-extra/clangd/tool/ClangdMain.cpp
+++ b/clang-tools-extra/clangd/tool/ClangdMain.cpp
@@ -573,8 +573,7 @@ llvm::cl::opt CheckCompletion{
 llvm::cl::desc("Run code-completion at each point (slow)"),
 llvm::cl::init(false)};
 llvm::cl::opt CheckWarnings{
-"check-warnings",
-llvm::cl::desc("Print warnings as well as errors"),
+"check-warnings", llvm::cl::desc("Print warnings as well as errors"),
 llvm::cl::init(false)};
 
 /// Supports a test URI scheme with relaxed constraints for lit tests.
@@ -1002,7 +1001,7 @@ clangd accepts flags on the commandline, and in the 
CLANGD_FLAGS environment var
 
 ClangdCheckOptions CheckOpts;
 if (CheckTidyTime.getNumOccurrences())
-CheckOpts.CheckTidyTime= std::make_optional(CheckTidyTime.ValueStr);
+  CheckOpts.CheckTidyTime = std::make_optional(CheckTidyTime.ValueStr);
 
 CheckOpts.CheckFileLines = CheckFileLines;
 CheckOpts.CheckCompletion = CheckCompletion;

___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [libc] [llvm] [compiler-rt] [clang] [flang] [clang-tools-extra] [NFC, Clangd] Refactor Check to have more explicit cli args. (PR #75867)

2023-12-21 Thread Andres Villegas via llvm-branch-commits

avillega wrote:

This is ready for review and passing all checks. If you think someone else 
needs to be included in the reviewers list please feel free to add them.

https://github.com/llvm/llvm-project/pull/75867
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] [clang] [compiler-rt] [libc] [clang-tools-extra] [flang] [NFC, Clangd] Refactor Check to have more explicit cli args. (PR #75867)

2024-01-02 Thread Andres Villegas via llvm-branch-commits

https://github.com/avillega updated 
https://github.com/llvm/llvm-project/pull/75867

>From e31560e8462108869f80b39dfd186efcf45a77f2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9s=20Villegas?= 
Date: Mon, 18 Dec 2023 22:56:01 +
Subject: [PATCH] Run git clang-format

Created using spr 1.3.5
---
 clang-tools-extra/clangd/tool/Check.cpp  | 6 +++---
 clang-tools-extra/clangd/tool/ClangdMain.cpp | 5 ++---
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/clang-tools-extra/clangd/tool/Check.cpp 
b/clang-tools-extra/clangd/tool/Check.cpp
index 7c04a2f16e5a30..5e9d8d53625b68 100644
--- a/clang-tools-extra/clangd/tool/Check.cpp
+++ b/clang-tools-extra/clangd/tool/Check.cpp
@@ -133,7 +133,8 @@ class Checker {
   // Number of non-fatal errors seen.
   unsigned ErrCount = 0;
 
-  Checker(llvm::StringRef File, const ClangdLSPServer::Options &Opts, const 
ClangdCheckOptions &CheckOpts)
+  Checker(llvm::StringRef File, const ClangdLSPServer::Options &Opts,
+  const ClangdCheckOptions &CheckOpts)
   : File(File), Opts(Opts), CheckOpts(CheckOpts) {}
 
   // Read compilation database and choose a compile command for the file.
@@ -473,8 +474,7 @@ bool check(llvm::StringRef File, const ThreadsafeFS &TFS,
 }
 
   public:
-OverrideConfigProvider(bool CheckTidyTime)
-: CheckTidyTime(CheckTidyTime) {}
+OverrideConfigProvider(bool CheckTidyTime) : CheckTidyTime(CheckTidyTime) 
{}
 
   } OverrideConfig{CheckOpts.CheckTidyTime.has_value()};
 
diff --git a/clang-tools-extra/clangd/tool/ClangdMain.cpp 
b/clang-tools-extra/clangd/tool/ClangdMain.cpp
index 34a227b2dbb286..3b08e023236dc1 100644
--- a/clang-tools-extra/clangd/tool/ClangdMain.cpp
+++ b/clang-tools-extra/clangd/tool/ClangdMain.cpp
@@ -573,8 +573,7 @@ llvm::cl::opt CheckCompletion{
 llvm::cl::desc("Run code-completion at each point (slow)"),
 llvm::cl::init(false)};
 llvm::cl::opt CheckWarnings{
-"check-warnings",
-llvm::cl::desc("Print warnings as well as errors"),
+"check-warnings", llvm::cl::desc("Print warnings as well as errors"),
 llvm::cl::init(false)};
 
 /// Supports a test URI scheme with relaxed constraints for lit tests.
@@ -1002,7 +1001,7 @@ clangd accepts flags on the commandline, and in the 
CLANGD_FLAGS environment var
 
 ClangdCheckOptions CheckOpts;
 if (CheckTidyTime.getNumOccurrences())
-CheckOpts.CheckTidyTime= std::make_optional(CheckTidyTime.ValueStr);
+  CheckOpts.CheckTidyTime = std::make_optional(CheckTidyTime.ValueStr);
 
 CheckOpts.CheckFileLines = CheckFileLines;
 CheckOpts.CheckCompletion = CheckCompletion;

___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [flang] [clang] [clang-tools-extra] [compiler-rt] [llvm] [libc] [NFC, Clangd] Refactor Check to have more explicit cli args. (PR #75867)

2024-01-02 Thread Andres Villegas via llvm-branch-commits

https://github.com/avillega updated 
https://github.com/llvm/llvm-project/pull/75867

>From e31560e8462108869f80b39dfd186efcf45a77f2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9s=20Villegas?= 
Date: Mon, 18 Dec 2023 22:56:01 +
Subject: [PATCH] Run git clang-format

Created using spr 1.3.5
---
 clang-tools-extra/clangd/tool/Check.cpp  | 6 +++---
 clang-tools-extra/clangd/tool/ClangdMain.cpp | 5 ++---
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/clang-tools-extra/clangd/tool/Check.cpp 
b/clang-tools-extra/clangd/tool/Check.cpp
index 7c04a2f16e5a30..5e9d8d53625b68 100644
--- a/clang-tools-extra/clangd/tool/Check.cpp
+++ b/clang-tools-extra/clangd/tool/Check.cpp
@@ -133,7 +133,8 @@ class Checker {
   // Number of non-fatal errors seen.
   unsigned ErrCount = 0;
 
-  Checker(llvm::StringRef File, const ClangdLSPServer::Options &Opts, const 
ClangdCheckOptions &CheckOpts)
+  Checker(llvm::StringRef File, const ClangdLSPServer::Options &Opts,
+  const ClangdCheckOptions &CheckOpts)
   : File(File), Opts(Opts), CheckOpts(CheckOpts) {}
 
   // Read compilation database and choose a compile command for the file.
@@ -473,8 +474,7 @@ bool check(llvm::StringRef File, const ThreadsafeFS &TFS,
 }
 
   public:
-OverrideConfigProvider(bool CheckTidyTime)
-: CheckTidyTime(CheckTidyTime) {}
+OverrideConfigProvider(bool CheckTidyTime) : CheckTidyTime(CheckTidyTime) 
{}
 
   } OverrideConfig{CheckOpts.CheckTidyTime.has_value()};
 
diff --git a/clang-tools-extra/clangd/tool/ClangdMain.cpp 
b/clang-tools-extra/clangd/tool/ClangdMain.cpp
index 34a227b2dbb286..3b08e023236dc1 100644
--- a/clang-tools-extra/clangd/tool/ClangdMain.cpp
+++ b/clang-tools-extra/clangd/tool/ClangdMain.cpp
@@ -573,8 +573,7 @@ llvm::cl::opt CheckCompletion{
 llvm::cl::desc("Run code-completion at each point (slow)"),
 llvm::cl::init(false)};
 llvm::cl::opt CheckWarnings{
-"check-warnings",
-llvm::cl::desc("Print warnings as well as errors"),
+"check-warnings", llvm::cl::desc("Print warnings as well as errors"),
 llvm::cl::init(false)};
 
 /// Supports a test URI scheme with relaxed constraints for lit tests.
@@ -1002,7 +1001,7 @@ clangd accepts flags on the commandline, and in the 
CLANGD_FLAGS environment var
 
 ClangdCheckOptions CheckOpts;
 if (CheckTidyTime.getNumOccurrences())
-CheckOpts.CheckTidyTime= std::make_optional(CheckTidyTime.ValueStr);
+  CheckOpts.CheckTidyTime = std::make_optional(CheckTidyTime.ValueStr);
 
 CheckOpts.CheckFileLines = CheckFileLines;
 CheckOpts.CheckCompletion = CheckCompletion;

___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [flang] [clang] [clang-tools-extra] [compiler-rt] [llvm] [libc] [NFC, Clangd] Refactor Check to have more explicit cli args. (PR #75867)

2024-01-02 Thread Andres Villegas via llvm-branch-commits

avillega wrote:

Ping reviewers.

https://github.com/llvm/llvm-project/pull/75867
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] [clang-tools-extra] [llvm] [Clangd] Migrate command line option parsin to opttable. (PR #76767)

2024-01-02 Thread Andres Villegas via llvm-branch-commits

https://github.com/avillega created 
https://github.com/llvm/llvm-project/pull/76767

The motivation for this change is to include clangd
as part of the multicall tool. Enable clangd in the
multicall driver tool will be done a following change.



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] [clang-tools-extra] [llvm] [Clangd] Migrate command line options parsing to opttable. (PR #76767)

2024-01-02 Thread Andres Villegas via llvm-branch-commits

https://github.com/avillega edited 
https://github.com/llvm/llvm-project/pull/76767
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang-tools-extra] [clang] [llvm] [Clangd] Migrate command line options parsing to opttable. (PR #76767)

2024-01-02 Thread Andres Villegas via llvm-branch-commits

https://github.com/avillega edited 
https://github.com/llvm/llvm-project/pull/76767
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang-tools-extra] [clang] [llvm] [Clangd] Migrate command line options parsing to opttable. (PR #76767)

2024-01-02 Thread Andres Villegas via llvm-branch-commits

https://github.com/avillega edited 
https://github.com/llvm/llvm-project/pull/76767
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang-tools-extra] [clang] [llvm] [Clangd] Migrate command line options parsing to opttable. (PR #76767)

2024-01-02 Thread Andres Villegas via llvm-branch-commits

https://github.com/avillega updated 
https://github.com/llvm/llvm-project/pull/76767

>From 787722d1b26003ff5ab4e197ae60874e4a6fbc40 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9s=20Villegas?= 
Date: Wed, 3 Jan 2024 00:07:13 +
Subject: [PATCH] Run git clang-format

Created using spr 1.3.5
---
 clang-tools-extra/clangd/tool/ClangdMain.cpp | 1 -
 1 file changed, 1 deletion(-)

diff --git a/clang-tools-extra/clangd/tool/ClangdMain.cpp 
b/clang-tools-extra/clangd/tool/ClangdMain.cpp
index ea122d1a585c84..ea155b8bf9435d 100644
--- a/clang-tools-extra/clangd/tool/ClangdMain.cpp
+++ b/clang-tools-extra/clangd/tool/ClangdMain.cpp
@@ -478,7 +478,6 @@ enum class ErrorResultCode : int {
   CheckFailed = 3
 };
 
-
 int clangdMain(int argc, char *argv[]) {
   // Clang could run on the main thread. e.g., when the flag '-check' or 
'-sync'
   // is enabled.

___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] [clang] [clang-tools-extra] [Clangd] Migrate command line options parsing to opttable. (PR #76767)

2024-01-02 Thread Andres Villegas via llvm-branch-commits
=?utf-8?q?Andrés?= Villegas 
Message-ID:
In-Reply-To: 


https://github.com/avillega updated 
https://github.com/llvm/llvm-project/pull/76767

>From 787722d1b26003ff5ab4e197ae60874e4a6fbc40 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9s=20Villegas?= 
Date: Wed, 3 Jan 2024 00:07:13 +
Subject: [PATCH 1/2] Run git clang-format

Created using spr 1.3.5
---
 clang-tools-extra/clangd/tool/ClangdMain.cpp | 1 -
 1 file changed, 1 deletion(-)

diff --git a/clang-tools-extra/clangd/tool/ClangdMain.cpp 
b/clang-tools-extra/clangd/tool/ClangdMain.cpp
index ea122d1a585c84..ea155b8bf9435d 100644
--- a/clang-tools-extra/clangd/tool/ClangdMain.cpp
+++ b/clang-tools-extra/clangd/tool/ClangdMain.cpp
@@ -478,7 +478,6 @@ enum class ErrorResultCode : int {
   CheckFailed = 3
 };
 
-
 int clangdMain(int argc, char *argv[]) {
   // Clang could run on the main thread. e.g., when the flag '-check' or 
'-sync'
   // is enabled.

>From d242f164d69ec606db9418c02c9588bffa429928 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9s=20Villegas?= 
Date: Wed, 3 Jan 2024 01:40:40 +
Subject: [PATCH 2/2] change uint to unsigned

Created using spr 1.3.5
---
 clang-tools-extra/clangd/tool/ClangdMain.cpp | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/clang-tools-extra/clangd/tool/ClangdMain.cpp 
b/clang-tools-extra/clangd/tool/ClangdMain.cpp
index ea155b8bf9435d..c846c7130e27c9 100644
--- a/clang-tools-extra/clangd/tool/ClangdMain.cpp
+++ b/clang-tools-extra/clangd/tool/ClangdMain.cpp
@@ -69,16 +69,16 @@
 namespace {
 
 #if defined(__GLIBC__) && CLANGD_MALLOC_TRIM
-static constexpr uint MallocTrimVis = (1 << 8);
+static constexpr unsigned MallocTrimVis = (1 << 8);
 #else
-static constexpr uint MallocTrimVis = 0;
+static constexpr unsigned MallocTrimVis = 0;
 #endif
 
 #if CLANGD_ENABLE_REMOTE
 // FIXME(kirillbobyrev): Should this be the location of compile_commands.json?
-static constexpr uint RemoteVis = (1 << 9);
+static constexpr unsigned RemoteVis = (1 << 9);
 #else
-static constexpr uint RemoteVis = 0;
+static constexpr unsigned RemoteVis = 0;
 #endif
 
 using namespace llvm;

___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] [compiler-rt] [lldb] [libc] [clang-tools-extra] [libcxxabi] [flang] [libcxx] [clang] [Clangd] Migrate command line options parsing to opttable. (PR #76767)

2024-01-03 Thread Andres Villegas via llvm-branch-commits
=?utf-8?q?Andrés?= Villegas 
Message-ID:
In-Reply-To: 


https://github.com/avillega updated 
https://github.com/llvm/llvm-project/pull/76767

>From 787722d1b26003ff5ab4e197ae60874e4a6fbc40 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9s=20Villegas?= 
Date: Wed, 3 Jan 2024 00:07:13 +
Subject: [PATCH 1/2] Run git clang-format

Created using spr 1.3.5
---
 clang-tools-extra/clangd/tool/ClangdMain.cpp | 1 -
 1 file changed, 1 deletion(-)

diff --git a/clang-tools-extra/clangd/tool/ClangdMain.cpp 
b/clang-tools-extra/clangd/tool/ClangdMain.cpp
index ea122d1a585c84..ea155b8bf9435d 100644
--- a/clang-tools-extra/clangd/tool/ClangdMain.cpp
+++ b/clang-tools-extra/clangd/tool/ClangdMain.cpp
@@ -478,7 +478,6 @@ enum class ErrorResultCode : int {
   CheckFailed = 3
 };
 
-
 int clangdMain(int argc, char *argv[]) {
   // Clang could run on the main thread. e.g., when the flag '-check' or 
'-sync'
   // is enabled.

>From d242f164d69ec606db9418c02c9588bffa429928 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9s=20Villegas?= 
Date: Wed, 3 Jan 2024 01:40:40 +
Subject: [PATCH 2/2] change uint to unsigned

Created using spr 1.3.5
---
 clang-tools-extra/clangd/tool/ClangdMain.cpp | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/clang-tools-extra/clangd/tool/ClangdMain.cpp 
b/clang-tools-extra/clangd/tool/ClangdMain.cpp
index ea155b8bf9435d..c846c7130e27c9 100644
--- a/clang-tools-extra/clangd/tool/ClangdMain.cpp
+++ b/clang-tools-extra/clangd/tool/ClangdMain.cpp
@@ -69,16 +69,16 @@
 namespace {
 
 #if defined(__GLIBC__) && CLANGD_MALLOC_TRIM
-static constexpr uint MallocTrimVis = (1 << 8);
+static constexpr unsigned MallocTrimVis = (1 << 8);
 #else
-static constexpr uint MallocTrimVis = 0;
+static constexpr unsigned MallocTrimVis = 0;
 #endif
 
 #if CLANGD_ENABLE_REMOTE
 // FIXME(kirillbobyrev): Should this be the location of compile_commands.json?
-static constexpr uint RemoteVis = (1 << 9);
+static constexpr unsigned RemoteVis = (1 << 9);
 #else
-static constexpr uint RemoteVis = 0;
+static constexpr unsigned RemoteVis = 0;
 #endif
 
 using namespace llvm;

___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang-tools-extra] [llvm] [clang] [sanitizer_symbolizer] Add end to end test for symbolizer markup. (PR #77702)

2024-01-10 Thread Andres Villegas via llvm-branch-commits

https://github.com/avillega created 
https://github.com/llvm/llvm-project/pull/77702

Add more tests for sanitizer symbolizer markup, that make sure
the output of the symbolizer markup can be symbolized by llvm-symbolizer.



___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang-tools-extra] [llvm] [clang] [sanitizer_symbolizer] Add end to end test for symbolizer markup. (PR #77702)

2024-01-10 Thread Andres Villegas via llvm-branch-commits

avillega wrote:

I plan to add some ubsan and hwasan test aswell, but asan and tsan are just 
faster to add right now.

https://github.com/llvm/llvm-project/pull/77702
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] [clang] [compiler-rt] [clang-tools-extra] [sanitizer_symbolizer] Add end to end test for symbolizer markup. (PR #77702)

2024-01-10 Thread Andres Villegas via llvm-branch-commits

https://github.com/avillega updated 
https://github.com/llvm/llvm-project/pull/77702

>From a3220262a3236115d55235e4cc34acc8202268f4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9s=20Villegas?= 
Date: Wed, 10 Jan 2024 23:56:45 +
Subject: [PATCH] Fix typo.

Created using spr 1.3.5
---
 .../test/asan/TestCases/use-after-free-symbolizer-markup.cpp| 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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 548ae57b5c3797..323de4ec7a36ed 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 is 
correctly symbolized  
 // REQUIRES: linux
 // RUN: %clangxx_asan %s -Wl,--build-id=0x12345678 -o %t.main
 // RUN: mkdir -p %t/.build-id/12

___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang-tools-extra] [clang] [compiler-rt] [llvm] [sanitizer_symbolizer] Add end to end test for symbolizer markup. (PR #77702)

2024-01-11 Thread Andres Villegas via llvm-branch-commits
=?utf-8?q?Andrés?= Villegas 
Message-ID:
In-Reply-To: 


https://github.com/avillega updated 
https://github.com/llvm/llvm-project/pull/77702

>From a3220262a3236115d55235e4cc34acc8202268f4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9s=20Villegas?= 
Date: Wed, 10 Jan 2024 23:56:45 +
Subject: [PATCH 1/2] Fix typo.

Created using spr 1.3.5
---
 .../test/asan/TestCases/use-after-free-symbolizer-markup.cpp| 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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 548ae57b5c3797..323de4ec7a36ed 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 is 
correctly symbolized  
 // REQUIRES: linux
 // RUN: %clangxx_asan %s -Wl,--build-id=0x12345678 -o %t.main
 // RUN: mkdir -p %t/.build-id/12

>From 29abe012394c582239b257a6a51b833b974743f1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9s=20Villegas?= 
Date: Thu, 11 Jan 2024 17:25:29 +
Subject: [PATCH 2/2] run git clang-format

Created using spr 1.3.5
---
 .../asan/TestCases/use-after-free-symbolizer-markup.cpp  | 9 -
 compiler-rt/test/tsan/simple_stack_symbolizer_markup.cpp | 6 ++
 2 files changed, 6 insertions(+), 9 deletions(-)

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 323de4ec7a36ed..8d818217eb5b63 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 is 
correctly symbolized  
+// COM: to do offline symbolization we only check that the current module 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 
 
-[[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 5798986d73839e..a4f5e0e9d9fe46 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;

___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [compiler-rt] [llvm] [clang] [clang-tools-extra] [sanitizer_symbolizer] Add end to end test for symbolizer markup. (PR #77702)

2024-01-11 Thread Andres Villegas via llvm-branch-commits
=?utf-8?q?Andrés?= Villegas 
Message-ID:
In-Reply-To: 



@@ -0,0 +1,33 @@
+// COM: End to end test for the sanitizer symbolizer markup. Since it uses 
debug info

avillega wrote:

Yes, COM is for comments 
(https://llvm.org/docs/CommandGuide/FileCheck.html#the-com-directive) I am 
probably being too cautious here and not using COM maight be fine since the 
comment doesn't have anything like look like a directive.

https://github.com/llvm/llvm-project/pull/77702
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] [compiler-rt] [clang-tools-extra] [clang] [sanitizer_symbolizer] Add end to end test for symbolizer markup. (PR #77702)

2024-01-11 Thread Andres Villegas via llvm-branch-commits
=?utf-8?q?Andrés?= Villegas 
Message-ID:
In-Reply-To: 



@@ -0,0 +1,57 @@
+// REQUIRES: linux
+// 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
+// RUN: llvm-symbolizer --filter-markup --debug-file-directory=%t < 
%t/sanitizer.out | FileCheck %s --dump-input=always
+
+#include "test.h"
+
+int Global;
+
+void __attribute__((noinline)) foo1() { Global = 42; }

avillega wrote:

Yes, I copied another test and modified it. My assumption was that it would be 
better to keep each test as an analogous to the original, so I tried to keep it 
as close to the original as possible. but I totally agree with your comment.

https://github.com/llvm/llvm-project/pull/77702
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] [clang-tools-extra] [clang] [compiler-rt] [sanitizer_symbolizer] Add end to end test for symbolizer markup. (PR #77702)

2024-01-11 Thread Andres Villegas via llvm-branch-commits
=?utf-8?q?Andrés?= Villegas 
Message-ID:
In-Reply-To: 



@@ -0,0 +1,33 @@
+// 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 is 
correctly symbolized
+// REQUIRES: linux

avillega wrote:

I don't think it is intended to change, at least no for now.

https://github.com/llvm/llvm-project/pull/77702
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [compiler-rt] [clang-tools-extra] [clang] [llvm] [sanitizer_symbolizer] Add end to end test for symbolizer markup. (PR #77702)

2024-01-11 Thread Andres Villegas via llvm-branch-commits
=?utf-8?q?Andrés?= Villegas 
Message-ID:
In-Reply-To: 



@@ -0,0 +1,33 @@
+// 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 is 
correctly symbolized
+// REQUIRES: linux
+// RUN: %clangxx_asan %s -Wl,--build-id=0x12345678 -o %t.main
+// RUN: mkdir -p %t/.build-id/12

avillega wrote:

Done

https://github.com/llvm/llvm-project/pull/77702
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [compiler-rt] [clang-tools-extra] [llvm] [clang] [sanitizer_symbolizer] Add end to end test for symbolizer markup. (PR #77702)

2024-01-11 Thread Andres Villegas via llvm-branch-commits
=?utf-8?q?Andrés?= Villegas 
Message-ID:
In-Reply-To: 



@@ -0,0 +1,33 @@
+// 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 is 
correctly symbolized
+// REQUIRES: linux
+// RUN: %clangxx_asan %s -Wl,--build-id=0x12345678 -o %t.main
+// RUN: mkdir -p %t/.build-id/12
+// RUN: cp %t.main %t/.build-id/12/345678.debug
+// RUN: %env_asan_opts=enable_symbolizer_markup=1 not %run %t.main 
2>%t/sanitizer.out
+// RUN: llvm-symbolizer --filter-markup --debug-file-directory=%t < 
%t/sanitizer.out | FileCheck %s
+
+#include 
+
+[[gnu::noinline]] char *alloc() {
+  char *x = (char *)malloc(10 * sizeof(char));
+  return x;
+}
+int main() {
+  char *x = alloc();
+  free(x);
+  return x[5];
+}
+// CHECK: {{.*ERROR: AddressSanitizer: heap-use-after-free on address}}

avillega wrote:

Done

https://github.com/llvm/llvm-project/pull/77702
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [compiler-rt] [clang-tools-extra] [llvm] [clang] [sanitizer_symbolizer] Add end to end test for symbolizer markup. (PR #77702)

2024-01-11 Thread Andres Villegas via llvm-branch-commits
=?utf-8?q?Andrés?= Villegas ,
=?utf-8?q?Andrés?= Villegas 
Message-ID:
In-Reply-To: 


https://github.com/avillega updated 
https://github.com/llvm/llvm-project/pull/77702

>From a3220262a3236115d55235e4cc34acc8202268f4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9s=20Villegas?= 
Date: Wed, 10 Jan 2024 23:56:45 +
Subject: [PATCH 1/3] Fix typo.

Created using spr 1.3.5
---
 .../test/asan/TestCases/use-after-free-symbolizer-markup.cpp| 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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 548ae57b5c3797..323de4ec7a36ed 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 is 
correctly symbolized  
 // REQUIRES: linux
 // RUN: %clangxx_asan %s -Wl,--build-id=0x12345678 -o %t.main
 // RUN: mkdir -p %t/.build-id/12

>From 29abe012394c582239b257a6a51b833b974743f1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9s=20Villegas?= 
Date: Thu, 11 Jan 2024 17:25:29 +
Subject: [PATCH 2/3] run git clang-format

Created using spr 1.3.5
---
 .../asan/TestCases/use-after-free-symbolizer-markup.cpp  | 9 -
 compiler-rt/test/tsan/simple_stack_symbolizer_markup.cpp | 6 ++
 2 files changed, 6 insertions(+), 9 deletions(-)

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 323de4ec7a36ed..8d818217eb5b63 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 is 
correctly symbolized  
+// COM: to do offline symbolization we only check that the current module 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 
 
-[[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 5798986d73839e..a4f5e0e9d9fe46 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;

>From 2f11f65aadc8411c544f60bd3af29529625bc177 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9s=20Villegas?= 
Date: Thu, 11 Jan 2024 20:21:04 +
Subject: [PATCH 3/3] Fix review comments

Created using spr 1.3.5
---
 .../use-after-free-symbolizer-markup.cpp  | 32 ++-
 .../tsan/simple_stack_symbolizer_markup.cpp   | 29 +
 2 files changed, 32 insertions(+), 29 deletions(-)

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 8d818217eb5b63..2da07892daf6c5 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,10 +1,12 @@
-// COM: End to end test for the sanitiz

[llvm-branch-commits] [compiler-rt] [clang-tools-extra] [llvm] [clang] [sanitizer_symbolizer] Add end to end test for symbolizer markup. (PR #77702)

2024-01-11 Thread Andres Villegas via llvm-branch-commits
=?utf-8?q?Andrés?= Villegas ,
=?utf-8?q?Andrés?= Villegas 
Message-ID:
In-Reply-To: 



@@ -0,0 +1,33 @@
+// 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 is 
correctly symbolized
+// REQUIRES: linux
+// RUN: %clangxx_asan %s -Wl,--build-id=0x12345678 -o %t.main
+// RUN: mkdir -p %t/.build-id/12
+// RUN: cp %t.main %t/.build-id/12/345678.debug
+// RUN: %env_asan_opts=enable_symbolizer_markup=1 not %run %t.main 
2>%t/sanitizer.out
+// RUN: llvm-symbolizer --filter-markup --debug-file-directory=%t < 
%t/sanitizer.out | FileCheck %s
+
+#include 
+
+[[gnu::noinline]] char *alloc() {
+  char *x = (char *)malloc(10 * sizeof(char));
+  return x;
+}
+int main() {
+  char *x = alloc();
+  free(x);
+  return x[5];
+}
+// CHECK: {{.*ERROR: AddressSanitizer: heap-use-after-free on address}}
+// CHECK: {{0x.* at pc 0x.* bp 0x.* sp 0x.*}}

avillega wrote:

Added CHECK-NEXT and CHECK-DAG in some places. because of how the symvolizer 
markup context elements currently work, it is possible to get a line containing 
module information in the middle of two lines that might be expected to be NEXT 
to each other. I think it is something we might want to review.

https://github.com/llvm/llvm-project/pull/77702
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [compiler-rt] [clang] [llvm] [clang-tools-extra] [sanitizer_symbolizer] Add end to end test for symbolizer markup. (PR #77702)

2024-01-11 Thread Andres Villegas via llvm-branch-commits
=?utf-8?q?Andrés?= Villegas ,
=?utf-8?q?Andrés?= Villegas 
Message-ID:
In-Reply-To: 



@@ -0,0 +1,33 @@
+// 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 is 
correctly symbolized
+// REQUIRES: linux
+// RUN: %clangxx_asan %s -Wl,--build-id=0x12345678 -o %t.main
+// RUN: mkdir -p %t/.build-id/12
+// RUN: cp %t.main %t/.build-id/12/345678.debug
+// RUN: %env_asan_opts=enable_symbolizer_markup=1 not %run %t.main 
2>%t/sanitizer.out
+// RUN: llvm-symbolizer --filter-markup --debug-file-directory=%t < 
%t/sanitizer.out | FileCheck %s
+
+#include 
+
+[[gnu::noinline]] char *alloc() {
+  char *x = (char *)malloc(10 * sizeof(char));
+  return x;
+}
+int main() {
+  char *x = alloc();
+  free(x);
+  return x[5];
+}
+// CHECK: {{.*ERROR: AddressSanitizer: heap-use-after-free on address}}
+// CHECK: {{0x.* at pc 0x.* bp 0x.* sp 0x.*}}
+// CHECK: {{READ of size 1 at 0x.* thread T0}}
+// CHECK: {{#0 0x.* main 
.*use-after-free-symbolizer-markup.cpp:}}[[@LINE-5]]

avillega wrote:

Done

https://github.com/llvm/llvm-project/pull/77702
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [compiler-rt] [clang-tools-extra] [clang] [llvm] [sanitizer_symbolizer] Add end to end test for symbolizer markup. (PR #77702)

2024-01-11 Thread Andres Villegas via llvm-branch-commits
=?utf-8?q?Andrés?= Villegas ,
=?utf-8?q?Andrés?= Villegas 
Message-ID:
In-Reply-To: 



@@ -0,0 +1,33 @@
+// 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 is 
correctly symbolized
+// REQUIRES: linux
+// RUN: %clangxx_asan %s -Wl,--build-id=0x12345678 -o %t.main
+// RUN: mkdir -p %t/.build-id/12
+// RUN: cp %t.main %t/.build-id/12/345678.debug
+// RUN: %env_asan_opts=enable_symbolizer_markup=1 not %run %t.main 
2>%t/sanitizer.out
+// RUN: llvm-symbolizer --filter-markup --debug-file-directory=%t < 
%t/sanitizer.out | FileCheck %s
+
+#include 
+
+[[gnu::noinline]] char *alloc() {
+  char *x = (char *)malloc(10 * sizeof(char));
+  return x;
+}
+int main() {
+  char *x = alloc();
+  free(x);
+  return x[5];
+}
+// CHECK: {{.*ERROR: AddressSanitizer: heap-use-after-free on address}}
+// CHECK: {{0x.* at pc 0x.* bp 0x.* sp 0x.*}}
+// CHECK: {{READ of size 1 at 0x.* thread T0}}
+// CHECK: {{#0 0x.* main 
.*use-after-free-symbolizer-markup.cpp:}}[[@LINE-5]]
+// 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: {{#1 0x.* alloc\(\) 
.*use-after-free-symbolizer-markup.cpp:}}[[@LINE-16]]

avillega wrote:

Done

https://github.com/llvm/llvm-project/pull/77702
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [compiler-rt] [clang-tools-extra] [clang] [llvm] [sanitizer_symbolizer] Add end to end test for symbolizer markup. (PR #77702)

2024-01-11 Thread Andres Villegas via llvm-branch-commits
=?utf-8?q?Andrés?= Villegas ,
=?utf-8?q?Andrés?= Villegas 
Message-ID:
In-Reply-To: 



@@ -0,0 +1,57 @@
+// REQUIRES: linux
+// 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
+// RUN: llvm-symbolizer --filter-markup --debug-file-directory=%t < 
%t/sanitizer.out | FileCheck %s --dump-input=always

avillega wrote:

Done

https://github.com/llvm/llvm-project/pull/77702
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [compiler-rt] [clang] [llvm] [clang-tools-extra] [sanitizer_symbolizer] Add end to end test for symbolizer markup. (PR #77702)

2024-01-11 Thread Andres Villegas via llvm-branch-commits
=?utf-8?q?Andrés?= Villegas ,
=?utf-8?q?Andrés?= Villegas 
Message-ID:
In-Reply-To: 



@@ -0,0 +1,57 @@
+// REQUIRES: linux
+// 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
+// RUN: llvm-symbolizer --filter-markup --debug-file-directory=%t < 
%t/sanitizer.out | FileCheck %s --dump-input=always
+
+#include "test.h"
+
+int Global;
+
+void __attribute__((noinline)) foo1() { Global = 42; }

avillega wrote:

Done

https://github.com/llvm/llvm-project/pull/77702
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [llvm] [clang] [clang-tools-extra] [compiler-rt] [sanitizer_symbolizer] Add end to end test for symbolizer markup. (PR #77702)

2024-01-11 Thread Andres Villegas via llvm-branch-commits
=?utf-8?q?Andrés?= Villegas ,
=?utf-8?q?Andrés?= Villegas ,
=?utf-8?q?Andrés?= Villegas 
Message-ID:
In-Reply-To: 


https://github.com/avillega updated 
https://github.com/llvm/llvm-project/pull/77702

>From a3220262a3236115d55235e4cc34acc8202268f4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9s=20Villegas?= 
Date: Wed, 10 Jan 2024 23:56:45 +
Subject: [PATCH 1/4] Fix typo.

Created using spr 1.3.5
---
 .../test/asan/TestCases/use-after-free-symbolizer-markup.cpp| 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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 548ae57b5c3797..323de4ec7a36ed 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 is 
correctly symbolized  
 // REQUIRES: linux
 // RUN: %clangxx_asan %s -Wl,--build-id=0x12345678 -o %t.main
 // RUN: mkdir -p %t/.build-id/12

>From 29abe012394c582239b257a6a51b833b974743f1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9s=20Villegas?= 
Date: Thu, 11 Jan 2024 17:25:29 +
Subject: [PATCH 2/4] run git clang-format

Created using spr 1.3.5
---
 .../asan/TestCases/use-after-free-symbolizer-markup.cpp  | 9 -
 compiler-rt/test/tsan/simple_stack_symbolizer_markup.cpp | 6 ++
 2 files changed, 6 insertions(+), 9 deletions(-)

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 323de4ec7a36ed..8d818217eb5b63 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 is 
correctly symbolized  
+// COM: to do offline symbolization we only check that the current module 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 
 
-[[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 5798986d73839e..a4f5e0e9d9fe46 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;

>From 2f11f65aadc8411c544f60bd3af29529625bc177 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9s=20Villegas?= 
Date: Thu, 11 Jan 2024 20:21:04 +
Subject: [PATCH 3/4] Fix review comments

Created using spr 1.3.5
---
 .../use-after-free-symbolizer-markup.cpp  | 32 ++-
 .../tsan/simple_stack_symbolizer_markup.cpp   | 29 +
 2 files changed, 32 insertions(+), 29 deletions(-)

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 8d818217eb5b63..2da07892daf6c5 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,10 +1,12 @@
-// COM: E

[llvm-branch-commits] [clang] [clang-tools-extra] [llvm] [compiler-rt] [sanitizer_symbolizer] Add end to end test for symbolizer markup. (PR #77702)

2024-01-11 Thread Andres Villegas via llvm-branch-commits
=?utf-8?q?Andrés?= Villegas ,
=?utf-8?q?Andrés?= Villegas ,
=?utf-8?q?Andrés?= Villegas 
Message-ID:
In-Reply-To: 



@@ -0,0 +1,58 @@
+// REQUIRES: linux
+// RUN: rm -rf %t
+// RUN: mkdir -p %t/.build-id/12
+// RUN: %clangxx_tsan %s -Wl,--build-id=0x12345678 -O1 -o %t/main
+// 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
+// RUN: llvm-symbolizer --filter-markup --debug-file-directory=%t < 
%t/sanitizer.out | FileCheck %s
+
+#include "test.h"
+
+int Global;
+
+[[gnu::noinline]] void foo1() { Global = 42; }
+
+[[gnu::noinline]] void bar1() {
+  volatile int tmp = 42;
+  int tmp2 = tmp;
+  (void)tmp2;
+  foo1();
+}
+
+[[gnu::noinline]] void foo2() {
+  volatile int tmp = Global;
+  int tmp2 = tmp;
+  (void)tmp2;
+}
+
+[[gnu::noinline]] void bar2() {
+  volatile int tmp = 42;
+  int tmp2 = tmp;
+  (void)tmp2;
+  foo2();
+}
+
+void *Thread1(void *x) {
+  barrier_wait(&barrier);
+  bar1();
+  return NULL;
+}
+
+int main() {
+  barrier_init(&barrier, 2);
+  pthread_t t;
+  pthread_create(&t, NULL, Thread1, NULL);
+  bar2();
+  barrier_wait(&barrier);
+  pthread_join(t, NULL);
+}
+
+//  CHECK: WARNING: ThreadSanitizer: data race
+//  CHECK:   Write of size 4 at {{.*}} by thread T1:
+//  CHECK-DAG: #0 {{0x.*}} foo1{{.*}} 
{{.*}}simple_stack_symbolizer_markup.cpp:[[#@LINE - 39]]
+// CHECK-NEXT: #1 {{0x.*}} bar1{{.*}} 
{{.*}}simple_stack_symbolizer_markup.cpp:[[#@LINE - 34]]
+// CHECK-NEXT: #2 {{0x.*}} Thread1{{.*}} 
{{.*}}simple_stack_symbolizer_markup.cpp:[[#@LINE - 17]]
+//  CHECK-DAG:   Previous read of size 4 at {{.*}} by main thread:
+//  CHECK-DAG: #0 {{0x.*}} foo2{{.*}} 
{{.*}}simple_stack_symbolizer_markup.cpp:[[#@LINE - 33]]
+// CHECK-NEXT: #1 {{0x.*}} bar2{{.*}} 
{{.*}}simple_stack_symbolizer_markup.cpp:[[#@LINE - 25]]

avillega wrote:

Given that the file name is added by the markup filter, I think is nice to have 
it. I could probably capture the name and avoid some repetition.

https://github.com/llvm/llvm-project/pull/77702
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang-tools-extra] [compiler-rt] [clang] [llvm] [sanitizer_symbolizer] Add end to end test for symbolizer markup. (PR #77702)

2024-01-11 Thread Andres Villegas via llvm-branch-commits
=?utf-8?q?Andrés?= Villegas ,
=?utf-8?q?Andrés?= Villegas ,
=?utf-8?q?Andrés?= Villegas 
Message-ID:
In-Reply-To: 



@@ -0,0 +1,58 @@
+// REQUIRES: linux
+// RUN: rm -rf %t
+// RUN: mkdir -p %t/.build-id/12
+// RUN: %clangxx_tsan %s -Wl,--build-id=0x12345678 -O1 -o %t/main
+// 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
+// RUN: llvm-symbolizer --filter-markup --debug-file-directory=%t < 
%t/sanitizer.out | FileCheck %s
+
+#include "test.h"
+
+int Global;
+
+[[gnu::noinline]] void foo1() { Global = 42; }
+
+[[gnu::noinline]] void bar1() {
+  volatile int tmp = 42;
+  int tmp2 = tmp;
+  (void)tmp2;
+  foo1();
+}
+
+[[gnu::noinline]] void foo2() {
+  volatile int tmp = Global;
+  int tmp2 = tmp;
+  (void)tmp2;
+}
+
+[[gnu::noinline]] void bar2() {
+  volatile int tmp = 42;
+  int tmp2 = tmp;
+  (void)tmp2;
+  foo2();
+}
+
+void *Thread1(void *x) {
+  barrier_wait(&barrier);
+  bar1();
+  return NULL;
+}
+
+int main() {
+  barrier_init(&barrier, 2);
+  pthread_t t;
+  pthread_create(&t, NULL, Thread1, NULL);
+  bar2();
+  barrier_wait(&barrier);
+  pthread_join(t, NULL);
+}
+
+//  CHECK: WARNING: ThreadSanitizer: data race
+//  CHECK:   Write of size 4 at {{.*}} by thread T1:
+//  CHECK-DAG: #0 {{0x.*}} foo1{{.*}} 
{{.*}}simple_stack_symbolizer_markup.cpp:[[#@LINE - 39]]

avillega wrote:

`{{.*}}simple_stack_symbolizer_markup.cpp` is not for name mangling or matching 
spaces. It is to avoid having to match the whole file path. The markup filter 
uses absolute paths when printing file names. `foo1{{.*}}` is necessary because 
depending on some flags it is possible that `foo1` is printed slightly 
different, so I am trying to make the test less fragile. I considered 
`0x[[%.8X]]` but was worried that not all targets might print 8 byte addresses 
and went with the less specific version and try to match anything after the 
`0x`, Do you think this might be a problem?

https://github.com/llvm/llvm-project/pull/77702
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] [clang-tools-extra] [llvm] [compiler-rt] [sanitizer_symbolizer] Add end to end test for symbolizer markup. (PR #77702)

2024-01-11 Thread Andres Villegas via llvm-branch-commits
=?utf-8?q?Andrés?= Villegas ,
=?utf-8?q?Andrés?= Villegas ,
=?utf-8?q?Andrés?= Villegas 
Message-ID:
In-Reply-To: 



@@ -0,0 +1,58 @@
+// REQUIRES: linux
+// RUN: rm -rf %t
+// RUN: mkdir -p %t/.build-id/12
+// RUN: %clangxx_tsan %s -Wl,--build-id=0x12345678 -O1 -o %t/main
+// 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
+// RUN: llvm-symbolizer --filter-markup --debug-file-directory=%t < 
%t/sanitizer.out | FileCheck %s
+
+#include "test.h"
+
+int Global;
+
+[[gnu::noinline]] void foo1() { Global = 42; }
+
+[[gnu::noinline]] void bar1() {
+  volatile int tmp = 42;
+  int tmp2 = tmp;
+  (void)tmp2;
+  foo1();
+}
+
+[[gnu::noinline]] void foo2() {
+  volatile int tmp = Global;
+  int tmp2 = tmp;
+  (void)tmp2;
+}
+
+[[gnu::noinline]] void bar2() {
+  volatile int tmp = 42;
+  int tmp2 = tmp;
+  (void)tmp2;
+  foo2();
+}
+
+void *Thread1(void *x) {
+  barrier_wait(&barrier);
+  bar1();
+  return NULL;
+}
+
+int main() {
+  barrier_init(&barrier, 2);
+  pthread_t t;
+  pthread_create(&t, NULL, Thread1, NULL);
+  bar2();
+  barrier_wait(&barrier);
+  pthread_join(t, NULL);
+}
+
+//  CHECK: WARNING: ThreadSanitizer: data race
+//  CHECK:   Write of size 4 at {{.*}} by thread T1:
+//  CHECK-DAG: #0 {{0x.*}} foo1{{.*}} 
{{.*}}simple_stack_symbolizer_markup.cpp:[[#@LINE - 39]]
+// CHECK-NEXT: #1 {{0x.*}} bar1{{.*}} 
{{.*}}simple_stack_symbolizer_markup.cpp:[[#@LINE - 34]]
+// CHECK-NEXT: #2 {{0x.*}} Thread1{{.*}} 
{{.*}}simple_stack_symbolizer_markup.cpp:[[#@LINE - 17]]
+//  CHECK-DAG:   Previous read of size 4 at {{.*}} by main thread:
+//  CHECK-DAG: #0 {{0x.*}} foo2{{.*}} 
{{.*}}simple_stack_symbolizer_markup.cpp:[[#@LINE - 33]]

avillega wrote:

Not necessarily. Contextual elements might get emitted any time a call to print 
a non contextual element happens. So it is possible that in between `Previous 
read of size 4 at {{.*}} by main thread:` and `#0...` some contextual elements 
get printed.

https://github.com/llvm/llvm-project/pull/77702
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang-tools-extra] [compiler-rt] [clang] [llvm] [sanitizer_symbolizer] Add end to end test for symbolizer markup. (PR #77702)

2024-01-11 Thread Andres Villegas via llvm-branch-commits
=?utf-8?q?Andrés?= Villegas ,
=?utf-8?q?Andrés?= Villegas ,
=?utf-8?q?Andrés?= Villegas 
Message-ID:
In-Reply-To: 



@@ -0,0 +1,58 @@
+// REQUIRES: linux
+// RUN: rm -rf %t
+// RUN: mkdir -p %t/.build-id/12
+// RUN: %clangxx_tsan %s -Wl,--build-id=0x12345678 -O1 -o %t/main
+// 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
+// RUN: llvm-symbolizer --filter-markup --debug-file-directory=%t < 
%t/sanitizer.out | FileCheck %s
+
+#include "test.h"
+
+int Global;
+
+[[gnu::noinline]] void foo1() { Global = 42; }
+
+[[gnu::noinline]] void bar1() {
+  volatile int tmp = 42;
+  int tmp2 = tmp;
+  (void)tmp2;
+  foo1();
+}
+
+[[gnu::noinline]] void foo2() {
+  volatile int tmp = Global;
+  int tmp2 = tmp;
+  (void)tmp2;
+}
+
+[[gnu::noinline]] void bar2() {
+  volatile int tmp = 42;
+  int tmp2 = tmp;
+  (void)tmp2;
+  foo2();
+}
+
+void *Thread1(void *x) {
+  barrier_wait(&barrier);
+  bar1();
+  return NULL;
+}
+
+int main() {
+  barrier_init(&barrier, 2);
+  pthread_t t;
+  pthread_create(&t, NULL, Thread1, NULL);
+  bar2();
+  barrier_wait(&barrier);
+  pthread_join(t, NULL);
+}
+
+//  CHECK: WARNING: ThreadSanitizer: data race
+//  CHECK:   Write of size 4 at {{.*}} by thread T1:
+//  CHECK-DAG: #0 {{0x.*}} foo1{{.*}} 
{{.*}}simple_stack_symbolizer_markup.cpp:[[#@LINE - 39]]
+// CHECK-NEXT: #1 {{0x.*}} bar1{{.*}} 
{{.*}}simple_stack_symbolizer_markup.cpp:[[#@LINE - 34]]
+// CHECK-NEXT: #2 {{0x.*}} Thread1{{.*}} 
{{.*}}simple_stack_symbolizer_markup.cpp:[[#@LINE - 17]]
+//  CHECK-DAG:   Previous read of size 4 at {{.*}} by main thread:
+//  CHECK-DAG: #0 {{0x.*}} foo2{{.*}} 
{{.*}}simple_stack_symbolizer_markup.cpp:[[#@LINE - 33]]

avillega wrote:

While what I wrote is true for real workloads, it might be impossible to 
trigger unless I specifically add code to the test to do it, i.e. load a module 
in at runtime. I might add a tests for that in another PR though. For now will 
try to make the tests use CHECK and CHECK-NEXT instead.

https://github.com/llvm/llvm-project/pull/77702
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] [compiler-rt] [clang-tools-extra] [llvm] [sanitizer_symbolizer] Add end to end test for symbolizer markup. (PR #77702)

2024-01-11 Thread Andres Villegas via llvm-branch-commits
=?utf-8?q?Andrés?= Villegas ,
=?utf-8?q?Andrés?= Villegas ,
=?utf-8?q?Andrés?= Villegas ,
=?utf-8?q?Andrés?= Villegas 
Message-ID:
In-Reply-To: 


https://github.com/avillega updated 
https://github.com/llvm/llvm-project/pull/77702

>From a3220262a3236115d55235e4cc34acc8202268f4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9s=20Villegas?= 
Date: Wed, 10 Jan 2024 23:56:45 +
Subject: [PATCH 1/5] Fix typo.

Created using spr 1.3.5
---
 .../test/asan/TestCases/use-after-free-symbolizer-markup.cpp| 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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 548ae57b5c3797..323de4ec7a36ed 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 is 
correctly symbolized  
 // REQUIRES: linux
 // RUN: %clangxx_asan %s -Wl,--build-id=0x12345678 -o %t.main
 // RUN: mkdir -p %t/.build-id/12

>From 29abe012394c582239b257a6a51b833b974743f1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9s=20Villegas?= 
Date: Thu, 11 Jan 2024 17:25:29 +
Subject: [PATCH 2/5] run git clang-format

Created using spr 1.3.5
---
 .../asan/TestCases/use-after-free-symbolizer-markup.cpp  | 9 -
 compiler-rt/test/tsan/simple_stack_symbolizer_markup.cpp | 6 ++
 2 files changed, 6 insertions(+), 9 deletions(-)

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 323de4ec7a36ed..8d818217eb5b63 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 is 
correctly symbolized  
+// COM: to do offline symbolization we only check that the current module 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 
 
-[[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 5798986d73839e..a4f5e0e9d9fe46 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;

>From 2f11f65aadc8411c544f60bd3af29529625bc177 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9s=20Villegas?= 
Date: Thu, 11 Jan 2024 20:21:04 +
Subject: [PATCH 3/5] Fix review comments

Created using spr 1.3.5
---
 .../use-after-free-symbolizer-markup.cpp  | 32 ++-
 .../tsan/simple_stack_symbolizer_markup.cpp   | 29 +
 2 files changed, 32 insertions(+), 29 deletions(-)

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 8d818217eb5b63..2da07892daf6c5 100644
--- a/compiler-rt/test/asan/TestCases/use-after-free-symbolizer-markup.cpp
+++ b/compiler-rt/test/asan/TestCases/use-after-free-symbolizer-markup.cp

[llvm-branch-commits] [clang] [compiler-rt] [clang-tools-extra] [llvm] [sanitizer_symbolizer] Add end to end test for symbolizer markup. (PR #77702)

2024-01-11 Thread Andres Villegas via llvm-branch-commits
=?utf-8?q?Andrés?= Villegas ,
=?utf-8?q?Andrés?= Villegas ,
=?utf-8?q?Andrés?= Villegas ,
=?utf-8?q?Andrés?= Villegas 
Message-ID:
In-Reply-To: 



@@ -0,0 +1,58 @@
+// REQUIRES: linux
+// RUN: rm -rf %t
+// RUN: mkdir -p %t/.build-id/12
+// RUN: %clangxx_tsan %s -Wl,--build-id=0x12345678 -O1 -o %t/main
+// 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
+// RUN: llvm-symbolizer --filter-markup --debug-file-directory=%t < 
%t/sanitizer.out | FileCheck %s
+
+#include "test.h"
+
+int Global;
+
+[[gnu::noinline]] void foo1() { Global = 42; }
+
+[[gnu::noinline]] void bar1() {
+  volatile int tmp = 42;
+  int tmp2 = tmp;
+  (void)tmp2;
+  foo1();
+}
+
+[[gnu::noinline]] void foo2() {
+  volatile int tmp = Global;
+  int tmp2 = tmp;
+  (void)tmp2;
+}
+
+[[gnu::noinline]] void bar2() {
+  volatile int tmp = 42;
+  int tmp2 = tmp;
+  (void)tmp2;
+  foo2();
+}
+
+void *Thread1(void *x) {
+  barrier_wait(&barrier);
+  bar1();
+  return NULL;
+}
+
+int main() {
+  barrier_init(&barrier, 2);
+  pthread_t t;
+  pthread_create(&t, NULL, Thread1, NULL);
+  bar2();
+  barrier_wait(&barrier);
+  pthread_join(t, NULL);
+}
+
+//  CHECK: WARNING: ThreadSanitizer: data race
+//  CHECK:   Write of size 4 at {{.*}} by thread T1:
+//  CHECK-DAG: #0 {{0x.*}} foo1{{.*}} 
{{.*}}simple_stack_symbolizer_markup.cpp:[[#@LINE - 39]]
+// CHECK-NEXT: #1 {{0x.*}} bar1{{.*}} 
{{.*}}simple_stack_symbolizer_markup.cpp:[[#@LINE - 34]]
+// CHECK-NEXT: #2 {{0x.*}} Thread1{{.*}} 
{{.*}}simple_stack_symbolizer_markup.cpp:[[#@LINE - 17]]
+//  CHECK-DAG:   Previous read of size 4 at {{.*}} by main thread:
+//  CHECK-DAG: #0 {{0x.*}} foo2{{.*}} 
{{.*}}simple_stack_symbolizer_markup.cpp:[[#@LINE - 33]]
+// CHECK-NEXT: #1 {{0x.*}} bar2{{.*}} 
{{.*}}simple_stack_symbolizer_markup.cpp:[[#@LINE - 25]]

avillega wrote:

Done

https://github.com/llvm/llvm-project/pull/77702
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] [compiler-rt] [clang-tools-extra] [llvm] [sanitizer_symbolizer] Add end to end test for symbolizer markup. (PR #77702)

2024-01-11 Thread Andres Villegas via llvm-branch-commits
=?utf-8?q?Andrés?= Villegas ,
=?utf-8?q?Andrés?= Villegas ,
=?utf-8?q?Andrés?= Villegas ,
=?utf-8?q?Andrés?= Villegas 
Message-ID:
In-Reply-To: 



@@ -0,0 +1,58 @@
+// REQUIRES: linux
+// RUN: rm -rf %t
+// RUN: mkdir -p %t/.build-id/12
+// RUN: %clangxx_tsan %s -Wl,--build-id=0x12345678 -O1 -o %t/main
+// 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
+// RUN: llvm-symbolizer --filter-markup --debug-file-directory=%t < 
%t/sanitizer.out | FileCheck %s
+
+#include "test.h"
+
+int Global;
+
+[[gnu::noinline]] void foo1() { Global = 42; }
+
+[[gnu::noinline]] void bar1() {
+  volatile int tmp = 42;
+  int tmp2 = tmp;
+  (void)tmp2;
+  foo1();
+}
+
+[[gnu::noinline]] void foo2() {
+  volatile int tmp = Global;
+  int tmp2 = tmp;
+  (void)tmp2;
+}
+
+[[gnu::noinline]] void bar2() {
+  volatile int tmp = 42;
+  int tmp2 = tmp;
+  (void)tmp2;
+  foo2();
+}
+
+void *Thread1(void *x) {
+  barrier_wait(&barrier);
+  bar1();
+  return NULL;
+}
+
+int main() {
+  barrier_init(&barrier, 2);
+  pthread_t t;
+  pthread_create(&t, NULL, Thread1, NULL);
+  bar2();
+  barrier_wait(&barrier);
+  pthread_join(t, NULL);
+}
+
+//  CHECK: WARNING: ThreadSanitizer: data race
+//  CHECK:   Write of size 4 at {{.*}} by thread T1:
+//  CHECK-DAG: #0 {{0x.*}} foo1{{.*}} 
{{.*}}simple_stack_symbolizer_markup.cpp:[[#@LINE - 39]]

avillega wrote:

I removed the redundant patterns, but kept the `{{0x.}}` match for addresses 
because I could find examples in the llvm-symbolizer docs of usages of 
different address sizes. 

https://github.com/llvm/llvm-project/pull/77702
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [clang] [compiler-rt] [clang-tools-extra] [llvm] [sanitizer_symbolizer] Add end to end test for symbolizer markup. (PR #77702)

2024-01-11 Thread Andres Villegas via llvm-branch-commits
=?utf-8?q?Andrés?= Villegas ,
=?utf-8?q?Andrés?= Villegas ,
=?utf-8?q?Andrés?= Villegas ,
=?utf-8?q?Andrés?= Villegas 
Message-ID:
In-Reply-To: 



@@ -0,0 +1,58 @@
+// REQUIRES: linux
+// RUN: rm -rf %t
+// RUN: mkdir -p %t/.build-id/12
+// RUN: %clangxx_tsan %s -Wl,--build-id=0x12345678 -O1 -o %t/main
+// 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
+// RUN: llvm-symbolizer --filter-markup --debug-file-directory=%t < 
%t/sanitizer.out | FileCheck %s
+
+#include "test.h"
+
+int Global;
+
+[[gnu::noinline]] void foo1() { Global = 42; }
+
+[[gnu::noinline]] void bar1() {
+  volatile int tmp = 42;
+  int tmp2 = tmp;
+  (void)tmp2;
+  foo1();
+}
+
+[[gnu::noinline]] void foo2() {
+  volatile int tmp = Global;
+  int tmp2 = tmp;
+  (void)tmp2;
+}
+
+[[gnu::noinline]] void bar2() {
+  volatile int tmp = 42;
+  int tmp2 = tmp;
+  (void)tmp2;
+  foo2();
+}
+
+void *Thread1(void *x) {
+  barrier_wait(&barrier);
+  bar1();
+  return NULL;
+}
+
+int main() {
+  barrier_init(&barrier, 2);
+  pthread_t t;
+  pthread_create(&t, NULL, Thread1, NULL);
+  bar2();
+  barrier_wait(&barrier);
+  pthread_join(t, NULL);
+}
+
+//  CHECK: WARNING: ThreadSanitizer: data race
+//  CHECK:   Write of size 4 at {{.*}} by thread T1:
+//  CHECK-DAG: #0 {{0x.*}} foo1{{.*}} 
{{.*}}simple_stack_symbolizer_markup.cpp:[[#@LINE - 39]]
+// CHECK-NEXT: #1 {{0x.*}} bar1{{.*}} 
{{.*}}simple_stack_symbolizer_markup.cpp:[[#@LINE - 34]]
+// CHECK-NEXT: #2 {{0x.*}} Thread1{{.*}} 
{{.*}}simple_stack_symbolizer_markup.cpp:[[#@LINE - 17]]
+//  CHECK-DAG:   Previous read of size 4 at {{.*}} by main thread:
+//  CHECK-DAG: #0 {{0x.*}} foo2{{.*}} 
{{.*}}simple_stack_symbolizer_markup.cpp:[[#@LINE - 33]]

avillega wrote:

Done

https://github.com/llvm/llvm-project/pull/77702
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits


[llvm-branch-commits] [compiler-rt] [clang-tools-extra] [llvm] [clang] [sanitizer_symbolizer] Add end to end test for symbolizer markup. (PR #77702)

2024-01-11 Thread Andres Villegas via llvm-branch-commits
=?utf-8?q?Andrés?= Villegas ,
=?utf-8?q?Andrés?= Villegas ,
=?utf-8?q?Andrés?= Villegas ,
=?utf-8?q?Andrés?= Villegas 
Message-ID:
In-Reply-To: 



@@ -0,0 +1,58 @@
+// REQUIRES: linux
+// RUN: rm -rf %t
+// RUN: mkdir -p %t/.build-id/12
+// RUN: %clangxx_tsan %s -Wl,--build-id=0x12345678 -O1 -o %t/main
+// 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
+// RUN: llvm-symbolizer --filter-markup --debug-file-directory=%t < 
%t/sanitizer.out | FileCheck %s
+
+#include "test.h"
+
+int Global;
+
+[[gnu::noinline]] void foo1() { Global = 42; }
+
+[[gnu::noinline]] void bar1() {
+  volatile int tmp = 42;
+  int tmp2 = tmp;
+  (void)tmp2;
+  foo1();
+}
+
+[[gnu::noinline]] void foo2() {
+  volatile int tmp = Global;
+  int tmp2 = tmp;
+  (void)tmp2;
+}
+
+[[gnu::noinline]] void bar2() {
+  volatile int tmp = 42;
+  int tmp2 = tmp;
+  (void)tmp2;
+  foo2();
+}
+
+void *Thread1(void *x) {
+  barrier_wait(&barrier);
+  bar1();
+  return NULL;
+}
+
+int main() {
+  barrier_init(&barrier, 2);
+  pthread_t t;
+  pthread_create(&t, NULL, Thread1, NULL);
+  bar2();
+  barrier_wait(&barrier);
+  pthread_join(t, NULL);
+}
+
+//  CHECK: WARNING: ThreadSanitizer: data race
+//  CHECK:   Write of size 4 at {{.*}} by thread T1:
+//  CHECK-DAG: #0 {{0x.*}} foo1{{.*}} 
{{.*}}simple_stack_symbolizer_markup.cpp:[[#@LINE - 39]]
+// CHECK-NEXT: #1 {{0x.*}} bar1{{.*}} 
{{.*}}simple_stack_symbolizer_markup.cpp:[[#@LINE - 34]]
+// CHECK-NEXT: #2 {{0x.*}} Thread1{{.*}} 
{{.*}}simple_stack_symbolizer_markup.cpp:[[#@LINE - 17]]
+//  CHECK-DAG:   Previous read of size 4 at {{.*}} by main thread:

avillega wrote:

Done

https://github.com/llvm/llvm-project/pull/77702
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits