[compiler-rt] Test PR, please ignore (PR #100439)
via llvm-commits
llvm-commits at lists.llvm.org
Sat Jul 27 17:45:02 PDT 2024
https://github.com/AdvenamTacet updated https://github.com/llvm/llvm-project/pull/100439
>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 1/4] 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"))
>From a9d61489cd47b2d4b7b0a2427cd4cf4cc6d8f41c Mon Sep 17 00:00:00 2001
From: Tacet <advenam.tacet at gmail.com>
Date: Fri, 26 Jul 2024 06:11:20 +0200
Subject: [PATCH 2/4] Update
compiler-rt/test/asan/TestCases/contiguous_container_crash.cpp
---
compiler-rt/test/asan/TestCases/contiguous_container_crash.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/compiler-rt/test/asan/TestCases/contiguous_container_crash.cpp b/compiler-rt/test/asan/TestCases/contiguous_container_crash.cpp
index 1a023bdd97e4f..2adf380139879 100644
--- a/compiler-rt/test/asan/TestCases/contiguous_container_crash.cpp
+++ b/compiler-rt/test/asan/TestCases/contiguous_container_crash.cpp
@@ -1,7 +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 unaligned-bad-bounds 2>&1 | FileCheck --check-prefix=CHECK-NOT-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
>From 1a1eba37594269ed41b1025084fdba38f14c278f Mon Sep 17 00:00:00 2001
From: Tacet <advenam.tacet at gmail.com>
Date: Fri, 26 Jul 2024 06:11:26 +0200
Subject: [PATCH 3/4] Update
compiler-rt/test/asan/TestCases/contiguous_container_crash.cpp
---
compiler-rt/test/asan/TestCases/contiguous_container_crash.cpp | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/compiler-rt/test/asan/TestCases/contiguous_container_crash.cpp b/compiler-rt/test/asan/TestCases/contiguous_container_crash.cpp
index 2adf380139879..6ab0eb10036f0 100644
--- a/compiler-rt/test/asan/TestCases/contiguous_container_crash.cpp
+++ b/compiler-rt/test/asan/TestCases/contiguous_container_crash.cpp
@@ -38,8 +38,7 @@ void BadBounds() {
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
+// CHECK-NOT-UNALIGNED-BAD-BOUNDS: beg is not aligned by
__sanitizer_annotate_contiguous_container(&t[1], &t[0] + 100, &t[0] + 101,
&t[0] + 50);
}
>From f624fd25419ddc0b889778d59b8d9d849f897912 Mon Sep 17 00:00:00 2001
From: Advenam Tacet <advenam.tacet at gmail.com>
Date: Sun, 28 Jul 2024 02:39:00 +0200
Subject: [PATCH 4/4] final
---
compiler-rt/test/asan/TestCases/contiguous_container_crash.cpp | 2 ++
1 file changed, 2 insertions(+)
diff --git a/compiler-rt/test/asan/TestCases/contiguous_container_crash.cpp b/compiler-rt/test/asan/TestCases/contiguous_container_crash.cpp
index 6ab0eb10036f0..917ce725abed3 100644
--- a/compiler-rt/test/asan/TestCases/contiguous_container_crash.cpp
+++ b/compiler-rt/test/asan/TestCases/contiguous_container_crash.cpp
@@ -2,6 +2,7 @@
// 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-NOT-UNALIGNED-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
@@ -39,6 +40,7 @@ void BadBounds() {
void UnalignedBadBounds() {
long t[100];
// CHECK-NOT-UNALIGNED-BAD-BOUNDS: beg is not aligned by
+// CHECK-UNALIGNED-BAD-BOUNDS: ERROR: AddressSanitizer: bad parameters to __sanitizer_annotate_contiguous_container
__sanitizer_annotate_contiguous_container(&t[1], &t[0] + 100, &t[0] + 101,
&t[0] + 50);
}
More information about the llvm-commits
mailing list