[compiler-rt] Test PR, please ignore (PR #100439)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 24 10:55:18 PDT 2024
https://github.com/AdvenamTacet created https://github.com/llvm/llvm-project/pull/100439
Just to confirm that the test works as intended
>From ffaad7310f8d0901e85f8992aa75f8bf7ba96c48 Mon Sep 17 00:00:00 2001
From: Advenam Tacet <advenam.tacet at gmail.com>
Date: Wed, 24 Jul 2024 19:53:13 +0200
Subject: [PATCH] just testing for #94103
---
.../asan/TestCases/contiguous_container_crash.cpp | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/compiler-rt/test/asan/TestCases/contiguous_container_crash.cpp b/compiler-rt/test/asan/TestCases/contiguous_container_crash.cpp
index 41fb2d61a3dec..1a023bdd97e4f 100644
--- a/compiler-rt/test/asan/TestCases/contiguous_container_crash.cpp
+++ b/compiler-rt/test/asan/TestCases/contiguous_container_crash.cpp
@@ -1,6 +1,7 @@
// RUN: %clangxx_asan -O %s -o %t
// RUN: not %run %t crash 2>&1 | FileCheck --check-prefix=CHECK-CRASH %s
// RUN: not %run %t bad-bounds 2>&1 | FileCheck --check-prefix=CHECK-BAD-BOUNDS %s
+// RUN: not %run %t unaligned-bad-bounds 2>&1 | FileCheck --check-prefix=CHECK-UNALIGNED-BAD-BOUNDS %s
// RUN: not %run %t odd-alignment 2>&1 | FileCheck --check-prefix=CHECK-CRASH %s
// RUN: not %run %t odd-alignment-end 2>&1 | FileCheck --check-prefix=CHECK-CRASH %s
// RUN: %env_asan_opts=detect_container_overflow=0 %run %t crash
@@ -35,6 +36,14 @@ void BadBounds() {
&t[0] + 50);
}
+void UnalignedBadBounds() {
+ long t[100];
+// CHECK-UNALIGNED-BAD-BOUNDS: ERROR: AddressSanitizer: bad parameters to __sanitizer_annotate_contiguous_container
+// CHECK-UNALIGNED-BAD-BOUNDS-NOT: beg is not aligned by
+ __sanitizer_annotate_contiguous_container(&t[1], &t[0] + 100, &t[0] + 101,
+ &t[0] + 50);
+}
+
int OddAlignment() {
int t[100];
t[60] = 0;
@@ -57,6 +66,8 @@ int main(int argc, char **argv) {
return TestCrash();
else if (!strcmp(argv[1], "bad-bounds"))
BadBounds();
+ else if (!strcmp(argv[1], "unaligned-bad-bounds"))
+ UnalignedBadBounds();
else if (!strcmp(argv[1], "odd-alignment"))
return OddAlignment();
else if (!strcmp(argv[1], "odd-alignment-end"))
More information about the llvm-commits
mailing list