[llvm-branch-commits] [compiler-rt] [NFC][sanitizer] Commit test for #106912 (PR #108289)

Vitaly Buka via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Sep 11 14:01:11 PDT 2024


https://github.com/vitalybuka updated https://github.com/llvm/llvm-project/pull/108289

>From a5e15941239fae2b006c7a0509fa278238fb1c8e Mon Sep 17 00:00:00 2001
From: Vitaly Buka <vitalybuka at google.com>
Date: Wed, 11 Sep 2024 13:46:26 -0700
Subject: [PATCH 1/3] more sanitizers

Created using spr 1.3.4
---
 .../TestCases/dlsym_alloc.cpp                 | 22 ++++++++++++++-----
 1 file changed, 17 insertions(+), 5 deletions(-)

diff --git a/compiler-rt/test/sanitizer_common/TestCases/dlsym_alloc.cpp b/compiler-rt/test/sanitizer_common/TestCases/dlsym_alloc.cpp
index 9d61a30d22c1bf..1806e57525f3de 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/dlsym_alloc.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/dlsym_alloc.cpp
@@ -25,23 +25,35 @@ extern "C" const char *__asan_default_options()
     __attribute__((disable_sanitizer_instrumentation)) {
   return test();
 }
-
+extern "C" const char *__hwasan_default_options()
+    __attribute__((disable_sanitizer_instrumentation)) {
+  return test();
+}
 extern "C" const char *__lsan_default_options()
     __attribute__((disable_sanitizer_instrumentation)) {
   return test();
 }
-
+extern "C" const char *__memprof_default_options()
+    __attribute__((disable_sanitizer_instrumentation)) {
+  return test();
+}
 extern "C" const char *__msan_default_options()
     __attribute__((disable_sanitizer_instrumentation)) {
   return test();
 }
-
+extern "C" const char *__nsan_default_options()
+    __attribute__((disable_sanitizer_instrumentation)) {
+  return test();
+}
+extern "C" const char *__rtsan_default_options()
+    __attribute__((disable_sanitizer_instrumentation)) {
+  return test();
+}
 extern "C" const char *__tsan_default_options()
     __attribute__((disable_sanitizer_instrumentation)) {
   return test();
 }
-
-extern "C" const char *__hwasan_default_options()
+extern "C" const char *__ubsan_default_options()
     __attribute__((disable_sanitizer_instrumentation)) {
   return test();
 }

>From fa0db86ba64d5e8639eff73f6eaf60cf52e109e9 Mon Sep 17 00:00:00 2001
From: Vitaly Buka <vitalybuka at google.com>
Date: Wed, 11 Sep 2024 13:49:28 -0700
Subject: [PATCH 2/3] format

Created using spr 1.3.4
---
 compiler-rt/test/sanitizer_common/TestCases/dlsym_alloc.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/compiler-rt/test/sanitizer_common/TestCases/dlsym_alloc.cpp b/compiler-rt/test/sanitizer_common/TestCases/dlsym_alloc.cpp
index 1806e57525f3de..ea4685b37316e6 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/dlsym_alloc.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/dlsym_alloc.cpp
@@ -9,7 +9,7 @@
 #include <stdlib.h>
 
 const char *test() __attribute__((disable_sanitizer_instrumentation)) {
-  void * volatile p = malloc(3);
+  void *volatile p = malloc(3);
   p = realloc(p, 7);
   free(p);
 

>From 20b52fbbb58db0a8358f4f6e48100e638b561223 Mon Sep 17 00:00:00 2001
From: Vitaly Buka <vitalybuka at google.com>
Date: Wed, 11 Sep 2024 13:51:46 -0700
Subject: [PATCH 3/3] cpp -> c

Created using spr 1.3.4
---
 .../TestCases/{dlsym_alloc.cpp => dlsym_alloc.c}                | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
 rename compiler-rt/test/sanitizer_common/TestCases/{dlsym_alloc.cpp => dlsym_alloc.c} (96%)

diff --git a/compiler-rt/test/sanitizer_common/TestCases/dlsym_alloc.cpp b/compiler-rt/test/sanitizer_common/TestCases/dlsym_alloc.c
similarity index 96%
rename from compiler-rt/test/sanitizer_common/TestCases/dlsym_alloc.cpp
rename to compiler-rt/test/sanitizer_common/TestCases/dlsym_alloc.c
index ea4685b37316e6..0c83e8556737bf 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/dlsym_alloc.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/dlsym_alloc.c
@@ -1,4 +1,4 @@
-// RUN: %clangxx -O0 -pthread %s -o %t && %run %t
+// RUN: %clangxx -O0 %s -o %t && %run %t
 
 // FIXME: TSAN does not use DlsymAlloc.
 // UNSUPPORTED: tsan



More information about the llvm-branch-commits mailing list