[mlir] [llvm] [libcxx] [compiler-rt] [clang] [CI] Add lld as compiler-rt dependecy (PR #78536)
Vitaly Buka via cfe-commits
cfe-commits at lists.llvm.org
Wed Jan 17 21:10:46 PST 2024
https://github.com/vitalybuka updated https://github.com/llvm/llvm-project/pull/78536
>From cbdd94e111df298caa38b007b1f46a82a7bac73a Mon Sep 17 00:00:00 2001
From: Vitaly Buka <vitalybuka at google.com>
Date: Wed, 17 Jan 2024 18:13:57 -0800
Subject: [PATCH] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20change?=
=?UTF-8?q?s=20to=20main=20this=20commit=20is=20based=20on?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Created using spr 1.3.4
[skip ci]
---
.../sanitizer_symbolizer_report.cpp | 3 ++-
.../TestCases/allocator_returns_null.cpp | 19 +++++++++++++++++--
2 files changed, 19 insertions(+), 3 deletions(-)
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_report.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_report.cpp
index 253dc10607a6ebe..8438e019591b58a 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_report.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_report.cpp
@@ -34,7 +34,8 @@ static bool FrameIsInternal(const SymbolizedStack *frame) {
return true;
const char *file = frame->info.file;
const char *module = frame->info.module;
- if (file && (internal_strstr(file, "/compiler-rt/lib/")))
+ if (file && (internal_strstr(file, "/compiler-rt/lib/") ||
+ internal_strstr(file, "/include/c++/")))
return true;
if (module && (internal_strstr(module, "libclang_rt.")))
return true;
diff --git a/compiler-rt/test/sanitizer_common/TestCases/allocator_returns_null.cpp b/compiler-rt/test/sanitizer_common/TestCases/allocator_returns_null.cpp
index ca6f637b9a3f505..1e4b0ed520b8a4d 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/allocator_returns_null.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/allocator_returns_null.cpp
@@ -34,17 +34,20 @@
// RUN: | FileCheck %s --check-prefix=CHECK-nnCRASH
// RUN: %env_tool_opts=allocator_may_return_null=1 %run %t new-nothrow 2>&1 \
// RUN: | FileCheck %s --check-prefix=CHECK-NULL
+// RUN: %env_tool_opts=allocator_may_return_null=0 not %run %t vector 2>&1 \
+// RUN: | FileCheck %s --check-prefix=CHECK-vCRASH
// TODO(alekseyshl): win32 is disabled due to failing errno tests, fix it there.
// UNSUPPORTED: ubsan, target={{.*windows-msvc.*}}
#include <assert.h>
#include <errno.h>
+#include <limits>
+#include <new>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <limits>
-#include <new>
+#include <vector>
int main(int argc, char **argv) {
assert(argc == 2);
@@ -60,6 +63,8 @@ int main(int argc, char **argv) {
(3UL << 30) + 1;
#endif
+ std::vector<char> v;
+
void *x = nullptr;
if (!strcmp(action, "malloc")) {
x = malloc(kMaxAllowedMallocSizePlusOne);
@@ -82,6 +87,14 @@ int main(int argc, char **argv) {
x = operator new(kMaxAllowedMallocSizePlusOne);
} else if (!strcmp(action, "new-nothrow")) {
x = operator new(kMaxAllowedMallocSizePlusOne, std::nothrow);
+ } else if (!strcmp(action, "vector")) {
+#if __LP64__ || defined(_WIN64)
+ v.resize(kMaxAllowedMallocSizePlusOne);
+ x = v.data();
+#else
+ // Fake it: 32bit fails early in std.
+ x = malloc(kMaxAllowedMallocSizePlusOne);
+#endif
} else {
assert(0);
}
@@ -117,6 +130,8 @@ int main(int argc, char **argv) {
// CHECK-nnCRASH: new-nothrow:
// CHECK-nnCRASH: #{{[0-9]+.*}}allocator_returns_null.cpp
// CHECK-nnCRASH: {{SUMMARY: .*Sanitizer: allocation-size-too-big.*allocator_returns_null.cpp.*}} in main
+// CHECK-vCRASH: #{{[0-9]+.*}}allocator_returns_null.cpp
+// CHECK-vCRASH: {{SUMMARY: .*Sanitizer: allocation-size-too-big.*allocator_returns_null.cpp.*}} in main
// CHECK-NULL: {{malloc|calloc|calloc-overflow|realloc|realloc-after-malloc|new-nothrow}}
// CHECK-NULL: errno: 12, x: 0
More information about the cfe-commits
mailing list